The Pragmatic Addict

Bind9 - Dynamic DNS

This is a quick how-to. This represents the bare minimum to get things working on a Debian system. Note: other systems may vary.

Bind9 config

First you need to create your zone file. The location of the file is very specific to Debian. Under the apparmor rules (/etc/apparmor.d/usr.sbin.named) this directory is granted write access, specicifically to dynamically updated zone files.


$TTL 3600
@ IN SOA ( 2404241555 1H 1H 1W 2H )

Next you need to reference the zone file to your config (/etc/bind/named.conf)

zone "" {
    type master;
    file "/var/lib/bind/";
    allow-update {; };

A few notes about this config:

Bind9 client

Bind9 has it’s own updater program nsupdate which can be found in the bind9-dnsutils package in Debian. Note that nsupdate doesn’t really have any command line options, a script needs to be fed into it.

Example script to use dhcp of my internet interface to update dyndns.



logger dhcp dyndns-pragmatic $new_ip_address

cat <<EOF | nsupdate 
update delete A
update add 0 A $new_ip_address
update delete A
update add 0 A $new_ip_address


Created: 2024-04-25 Modified: 2024-04-27