1
0
Fork 0
mirror of https://github.com/tunix/digitalocean-dyndns synced 2024-12-21 12:29:52 +00:00
Dynamic DNS using DigitalOcean's DNS Services
Find a file
Alper Kanat 9d6d48e00d
Merge pull request #22 from lawtancool/master
Fix breakage when there are multiple DNS records for a single subdomain
2021-07-09 01:11:26 +03:00
Dockerfile Update Dockerfile 2020-12-14 12:57:34 +03:00
dyndns.sh Fix indentation 2021-07-04 17:30:45 -07:00
README.md Add REMOVE_DUPLICATES env variable 2021-07-04 17:22:17 -07:00

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 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