Dynamic DNS (DYDNS) – dme_update
Dynamic DNS is a system that allows for a DNS entry, commonly internet facing to be updated in real-time. This enables a connection to be established to a Dynamic IP Address (generally issued by an ISP) via a DNS name.
One implementation of this is DME Update which uses a simple Perl script to get the current external IP address and forms a URL which is used to update the DNS provider DNS Made Easy
My use for this has been through my Buffalo TeraStation which runs a cut down version of Linux and has the DME Update script running as a cron job. This allows me to always be able reach it without remembering an IP address.
The implementation for this is relatively simply, the requirements are:
- wget – A well known command line HTTP retrieval program
- Perl installed (exact version and pm files are unknown)
- The dme_update script and config files which are here
First of all edit the config.pl file and set the $nic variable to the name of the network interface that should be doing the lookup, also set the $getip_ext variable to either 0 to use the IP address of the NIC, or 1 to use the external webpage quoted.
The next stage is to provide the DNS record details that need to be updated on DNS Made Easy, this should be placed in the records folder in a file with the following information
username
password
DNS Made Easy record ID
current record IP address
An example is:
myUsername
myPassword
1234567
22.22.22.1
To update the DNS record run the following:
perl /etc/cron.d/dyDNS/dme_update -r myRecordFile
I’m sure there are many more implementations avaliable and for many different DNS providers, however this appealed to me due to the simplicity. The end result from the Perl scirpt is a formatted URL which either updates the DNS entry if required, or does nothing. Example URL is:
http://www.dnsmadeeasy.com/servlet/updateip?username=myUsername&password=myPassword&id=1234567&ip=22.22.22.2