Dynamic DNS Updates How-to

Need help? Ask here.

Moderator: Moderators

Post Reply
dstutz
Posts: 21
Joined: Mon May 08, 2006 4:30 pm

Dynamic DNS Updates How-to

Post by dstutz »

I just spent a bit of time getting this working and wanted to share in case it helped anyone because it shouldn't be as hard as it was and this post is as much for my benefit in the future as anyone else :D .

Instructions are for using ddclient 4.0.0 on a Linux system and Rollernet as of July 2026 implementing dynamic updates using DNS Update (RFC2136). There are plenty of other ways to end up in the same place...

1. On Rollernet website, go to Primary DNS settings and click TSIG tab (https://acc.rollernet.us/dns/primary.php), choose your algorithm, key name and toss in your shared secret.

2. On your system, create a key file for the credentials. Name it appropriately and should only be readable by the ddclient user. Contents should be, with <inputs from the TSIG page>:

Code: Select all

key "<Key Name from TSIG table>" {
  algorithm <algorithm from TSIG table>;
  secret "<click on View Secret and copy the Base-64 Encoded Shared Secret>";
};
3. Create ddclient config (more info here https://ddclient.net/). My distribution had an example config that had defaults for the "globals" and then tons of examples for all the different providers and ways to get IP info. I'm not saying this is the only option, but this is what is working for me with a relatively simple setup:

Code: Select all

daemon=3600                     # check every 3600 seconds
ttl=3600			# match the ttl in the update settings to how often you are running the daemon (happy to be told this should be higher/lower?)
syslog=yes                      # log update msgs to syslog
mail-failure=root               # mail failed update msgs to root

#this provides your public IP address, I saw something about not hitting the service too often (hence daemon=3600)
use=web, web=checkip.dyndns.org

#alternative if you want to set a specific IP (I used this for testing while getting everything working so I wasn't hammering the lookup service)
#use=ip, ip=<IP>

protocol=nsupdate				# use the RFC2136 protocol that Rollernet supports
server=dnsupdate.acc.rollernet.us:5300  	# Rollernet-specific setting
zone=<your dns zone to update, eg example.com>
password=/path/to/keyfile/you/created/in/step2.key
example.com,mail.example.com			# last line is the hosts to update on the server, can be one, can be more, comma-separated

#If you have multiple zones, you can add more but you just need zone, password, and hosts to update:
#zone=another.com
#password=/same/or/another/keyfile.key
#another.com,www.another.com
So for simple cases you just need a single key file and 8-10 lines in the ddclient.conf.

4. Test it:

Code: Select all

sudo -u ddclient ddclient --foreground --debug --verbose
You should see a bunch of output, but towards the bottom look for 2 things specifically:
Look for status: NOERROR

Code: Select all

Reply from update query:
;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id:   4806
Look for NOERROR at the end of that line:

Code: Select all

;; TSIG PSEUDOSECTION:
<TSIG KEY NAME>.       0       ANY     TSIG    <TSIG KEY ALG>. 1783635990 300 64 <Some Base64> 4806 NOERROR 0
If you go back and look at your zone info you can confirm the IP/TTL has been updated, or use dig, nslookup, or online tools to confirm.

5. Set ddclient to run periodically/as a service. This, I leave as an exercise for the reader to make it work for your setup. On my Gentoo system I just had to:

Code: Select all

rc-update add ddclient
/etc/init.d/ddclient start
Post Reply