1
0
A simple script to automatically update Digital ocean DNS records with dynamic IP
Go to file
2017-09-18 18:50:07 +05:30
.gitignore init 2017-08-30 17:32:49 +05:30
digitalocean-dynamic-ip.go change config file to be placed in home directory 2017-09-18 18:50:07 +05:30
digitalocean-dynamic-ip.sample.json change config file to be placed in home directory 2017-09-18 18:50:07 +05:30
LICENSE.md init 2017-08-30 17:32:49 +05:30
README.md change config file to be placed in home directory 2017-09-18 18:50:07 +05:30

DIGITAL OCEAN DYNAMIC IP API CLIENT

A simple script in Go language to automatically update Digital ocean DNS records if you have a dynamic IP. Since it can be compiled on any platform, you can use it along with raspberrypi etc.

requirements

Requires Git and Go for building.

Requires that the record already exists in DigitalOcean's DNS.

Usage

git clone https://github.com/anaganisk/digitalocean-dynamic-dns-ip.git

create a file ".digitalocean-dynamic-ip.json"(dot prefix to hide the file) and place it user home directory and add the following json

{
  "apikey": "samplekeydasjkdhaskjdhrwofihsamplekey",
  "domain": "example.com",
  "records": [
    {
      "name": "subdomain",
      "type": "A"
    }
  ]
}
#run
go build digitalocean-dynamic-ip.go
./digitalocean-dynamic-ip

You can either set this to run periodically with a cronjob or use your own method.

# run crontab -e
# sample cron job task 

# m h  dom mon dow   command
*/5 * * * * /home/user/digitalocean-dynamic-dns-ip/digitalocean-dynamic-ip