Howto: Test DDNS Updates

Howto test DDNS updates

Requirements

Use correct DNS backend

Make sure your host uses Samba as backend:

ucr get dns/backend
samba4

Step 1

Get a Kerberos Ticket to authenticate the update:

kinit -t /var/lib/samba/private/dns.keytab dns-$(hostname)

Step 2

Update forward zone:

echo -ne "server 127.0.0.1
update add newhost.$(ucr get domainname) 300 IN A 192.168.0.132
send
"| nsupdate -d -g -t15

Step 3

Verify the entry made is successfully:
host testhost.$(ucr get domainname)

Step 4 (optional)

Update reverse zone. Make sure you use the correct reverse-IP address:

echo -ne "server 127.0.0.1
update add 132.0.168.192.in-addr.arpa 300 IN PTR testhost.$(ucr get domainname)
send
"| nsupdate -d -g -t15

Step 5 (optional)

If needed, create a CNAME record:

echo -ne "server 127.0.0.1
update add newhost2.$(ucr get domainname) 600 CNAME oldhost.multi.ucs
send
"| nsupdate -d -g -t15

Step 6

Verify entry was updated:

dig -x 192.168.0.132
dig testhost.$(ucr get domainname)
dig newhost2.$(ucr get domainname)

Further Information

Further examples about how to use nsupdate can be found here.

Mastodon