Foxular.net
Dynamic DNS Updater
 

A friend of mine bought a domain name with the intent to host it off his home connection, but his IP address changes frequently. I offered to host DNS for him, and to write a script to have his server keep mine posted on the proper IP.

I configured my BIND 9 server to accept dynamic DNS updates for his zone, using SIG(0) authentication, but there still wasn't a very easy way to actually send the DDNS updates.

My script checks from www.whatismyip.com for the external IP address of the computer it's run on, then does a DNS query for the domain it's responsible for keeping updated. If the IPs don't match, it pushes a new DNS update. This solution seemed the most simple, as it doesn't have to keep track on its own if it has sent an update already or not.

This script is written in Perl, and relies on the nsupdate utility included with BIND. It is designed to be run from a crontab on a continuous loop. (whatismyip.com requests that you don't run it more often than once every five minutes.)

Download: ddns.pl (Requires the nsupdate utility as well as the perl modules LWP and Net::DNS)

Go back to the main page.

Site created by Hadley.