Code Monkey home page Code Monkey logo

digitalocean-dyndns's Introduction

Dynamic DNS using DigitalOcean's DNS Services

A script that pushes the public IP address of the running machine to DigitalOcean's DNS API's. It requires an existing A record to update. The resulting container image is roughly around 7 MB (thanks to Alpine Linux).

Setup

Assuming you already have a DigitalOcean account and your domain associated with it. Just add an A record with desired name and IP address. That's it!

Usage

Pick one of the options below using the following settings:

  • DIGITALOCEAN_TOKEN: The token you generate in DigitalOcean's API settings.
  • DOMAIN: The domain your subdomain is registered at. (i.e. foo.com for home.foo.com)
  • NAME: Subdomain to use. (name in A record) (i.e. home for home.foo.com). Multiple subdomains must be separated by semicolons ;
  • SLEEP_INTERVAL: Polling time in seconds. (default: 300)
  • REMOVE_DUPLICATES: If set to "true", removes extra DNS records if more than one A record is found on a subdomain. Note that if this is not enabled, the script will NOT update subdomains with more than one A record (default: false)

Docker (Recommended)

$ docker pull tunix/digitalocean-dyndns
$ docker run -d --name dyndns \
    -e DIGITALOCEAN_TOKEN="your_token_here" \
    -e DOMAIN="yourdomain.com" \
    -e NAME="subdomain" \
    -e SLEEP_INTERVAL=2 \
    -e REMOVE_DUPLICATES="true" \
    tunix/digitalocean-dyndns

Manual

You can also create a cronjob using below command:

$ DIGITALOCEAN_TOKEN="your_token_here" DOMAIN="yourdomain.com" NAME="subdomain" SLEEP_INTERVAL=2 ./dyndns.sh

digitalocean-dyndns's People

Contributors

aklinkert avatar axelanderk avatar billimek avatar ifrido avatar joelanford avatar jtsymon avatar lawtancool avatar otherguy avatar ringvold avatar tunix avatar wbio avatar zzeneg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

digitalocean-dyndns's Issues

TTL Should Match SLEEP_INTERVAL

I've recently been hitting a problem with duplicate records. Not sure why, as this never happened before, but, I've set REMOVE_DUPLICATES to true and now seems to be working okay.

What I noticed, was that the records in my dashboard show with a long TTL (1800 seconds), whilst the SLEEP_INTERVAL is 60s.

I think, if possible, it would be nice if records created by the container had a TTL matching the sleep interval - or if this could be a tunable option if not desireable. As, if the records is set to last longer than the interval for checking, this feels like it could cause some issues when it gets updated.

Thanks!

IP address is wrong

I know this isn't an error with this script per se; but seems like the call to get the IP address returns two different addresses for me; one when accessing over HTTP and one over HTTPS, which is very odd :/

Do you know who I can get in contact with there ? potentially we could use another separate service ?

curl -4 http://ifconfig.co returns incorrect IP

curl -4 https://ifconfig.co returns correct IP

Arm64 image

Would it be possible to get an arm64 compatible image? Thanks!

Getting no a record for domain

Hello guys,

love the work here. Somehow I am getting error all over the place. I tried the docker image and script on my arm device and resolving in the error: no a record found for domain. But there is an a record set for it. Even deleted the one and recreated it. Any ideas?

Best regards

Duplicate records created, still with the old IP

My IP address recently changed, and after 24 hours, the DNS record still pointed to the old IP. The logs show multiple (successful?) attempts to update the DNS records, but somehow it failed.

91.64.141.XXX) doesn't match current IP (91.64.142.XXX), sending data={"type": "A", "name": "XXXXX", "data": "91.64.142.XXX"} to url=https://api.digitalocean.com/v2/domains/XXXXXXX.com/records/120829XXX

I logged in to my Digitalocean dashboard, and saw 5-6 duplicate entries for that subdomain in the Networking tab, all showing the old IP.

IPV6 Support

Hi,

One of my machines has just randomly been assigned an IPV6 external address. I've not seen this before myself, it's on a domestic broadband connection and so far I have always had a V4 IP.

Would it be a feasible amount of work to add support for creating/updating AAAA records when a V6 IP is detected from the services at all?

Cheers

Update image on docker hub

Hi,

could you please add a CD pipeline for the docker image over at docker hub? I'd like to use the latest changes, would be cool to have these built. :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.