Skip to content

Bash script to automatically add/update Digital Ocean DNS record for a domain.

License

Notifications You must be signed in to change notification settings

santropolroulant/do_dns_update

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

Digital Ocean Dynamic DNS Updater

Simple Bash script to automatically add/update Digital Ocean DNS record for a domain. Includes basic error checking and common linux commands only, except for jq which is designed to be easy to install.

My use case: Connect to home server that is on a dynamic IP via a fixed domain (ala DynDNS). (e.g.- nas.mydomain.com vs. 74.125.231.100)

Usage

  1. Generate Personal Access Token from your Digital Ocean account.

  2. Place the token in ~/.config/do_dns_update/access_token

  3. Cron the script to update Digital Ocean's DNS at desired frequency. (Note: DO API rate limit is currently 1200 /hr. Each script run uses 2 calls.)

     # four times an hour
     */15 * * * * /path/to/file/do_dns_update.sh -s nas mydomain.com
    

Options

$ ./do_dns_update.sh -h

Usage: do_dns_update.sh [options...] <record name> <domain>
Options:
  -h      This help text
  -u      Updates only. Don't add non-existing
  -s      Silent mode. Don't output anything

Requires

  • Domain added on Digital Ocean.
  • Crontab or equivalent.
  • Available linux commands: jq, curl, grep, mktemp, sed, tr

Adapted From

PHP / Python version

License

The MIT License (MIT).

About

Bash script to automatically add/update Digital Ocean DNS record for a domain.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%