This script allows you to dynamically update a DO domain name 'A' record, a'la mini dynamic-dns.
Simply enter your D.O. client credentials at the top of the script. Set the domain you want to update and the ‘Record’ for that domain and schedule the script to run however often you want (using for example the Windows Scheduler or a cron job).
My home server has a sticky IP, I want to be able to connect to it remotely using:
home.joebloggs.com
I’d create an ‘A’ record in DO with the hostname ‘home’, under the domain ‘joebloggs.co.uk’ and while I was there retrieve my API credentials.
If you’re using the python or updater.php script you’ll need a (client ID & key, v1 of the API). If however your using the v2 of the API (updater-v2.php and recommended) then you’ll need to generate a ‘Personal Access Token’.
by: Ben SquireSeptember 23, 2014Visit site
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Have you created an Integration, API Wrapper, Service, or other Tool that helps developers build on DigitalOcean? Help users find it by listing it in Community Tools.
Here’s an alternative I wrote, which I think is much more secure.
https://github.com/benyanke/configScripts/tree/master/dns-update-server
In this case, the DO api key only exists on a single central API server with this script, and every other host can connect to this api server to inform it of it’s IP. This means your DO keys (which provide complete access to your DO account) are not spread around on multiple hosts.
I’ve been thinking about making a quick small .NET application that sits and watches your IP, and only pushes an update when the IP changes. Glad I’m not the only one thinking about this. I wish I could have my router natively do this : (