A Python 3 script to update DNS on DigitalOcean. https://gitlab.no/rune/py-dyndns
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rune Olsen d8d9f2bfc8 Added formating to timestamp 2 years ago
.gitignore Updates 3 years ago
README.md Updated readme.md 2 years ago
config-template.ini Added support for multiple domains 3 years ago
py-dyndns.py Added formating to timestamp 2 years ago



PY-DYNDNS is a small Python app that updates DNS records on you Digital Ocean account.


Clone this repo with git clone https://gitlab.no/rune/py-dyndns.git. To get your API key, log in to your Digital Ocean account and click the API link at the top of the page. Follow the instructions! Edit the config.json file with your information.

Rename the config-template.ini to config.ini and fill in the values needed.

This is made based on Python 3 so you need Python3 to use it!


Change permission of the file to be excecutable chmod +x py-dyndns.py and run it with ./py-dyndns.py

  • To list all subdomains on main domain in config.ini; ./py-dyndns.py -l
  • To show current IP's for domains in config.ini; ./py-dyndns.py -c
  • To add a new domain; ./py-dyndns.py -a domainname
  • To show help; ./py-dyndns.py -h

To update all subdomains in config.ini run the app without arguments.

The best way to use this is with cron. To run the app every second hour create a cron job like this:

0 1-23/2 * * * py-dyndns.py >/dev/null 2>&1


  • Add IPv6
  • Add possibility to list sub domain(s) with domainid(s)
  • Add help text
  • Add possibility to update more than one domain