BIND (Berkeley Internet Name Domain), a DNS server, can do that for you. A German Howto (Google-translated variant) shows you how to set that up on your own server. An extract here:
- A Linux machine with fixed IP that acts as DNS and Web server
- Software: Apache Webserver (any other webserver should do as well), Bind. Both are available in the standard repositories of almost every Linux distribution.
In the following lines, replace
example.com by your own domain.
- Create a key:
/usr/sbin/ddns-confgen -z example.com
- Store the key into a file, e.g.
- include that file in your
- or copy-paste it into
Copy-paste the "update-policy" into the "zone" block of "example.com", e.g.
grant ddns-key.example.com zonesub ANY;
At the end of your zone file (
/etc/bind/example.com), add the following lines:
$TTL 60 ; 1 min time-to-live
myhost A 192.168.1.11 ; any IP will do initially
Restart bind (a reload is not enough):
service bind9 restart
Here you need a simple PHP script, an example can be found on the linked page. It expects username and password as URL parameters (which it then compares with its own settings), and obtains the current IP via a third parameter (you could also simply evaluate
$_SERVER['REMOTE_ADDR'] instead), then writes the latter to a file.
Updater Script via Cron
The third component is a simple shell script invoked via Cron (a 5min interval should be sufficient). This checks for the file, compares the IP address with a backup from the previous run, and if it changed calls to Bind for an update. Finally it overwrites the backup (from the previous run) with the current file.
Easy-peasy. Just something that calls the web page and authenticates. I strongly recommend using HTTPS here (after all, you submit your user and password as URL parameters – so anyone capturing that could afterwards foul your DynDNS). Simplest thing is a Cron job doing so via Curl or WGet every 30min or so. If you've got something that notices your IP change, all the better – let that call the URL then. No special "client software" needed.
It would go beyond the scope of this site to include the entire setup (I personally use an extended version of this, which can support multiple clients). I can really recommend this setup: as written initially, the software I recommend here is BIND which runs very stable and is used on quite many installations, being the de-facto standard for name servers. I run this since the day DynDNS went "completely paid" (which was more than 2 years ago) – and except for about an hour to set it up once, I've never actually touched it anymore: it simply works.