Nsd /

NSD Zone Files

Adding records to zone files

Suppose you want to create an entry for subdomain.example.com.

First, open up the file /var/nsd/zones/master/example.com and add these two lines:

subdomain    3600    IN      A  
             3600    IN      AAAA    2602:fccf:1:1008::

Then, you will want to update the serial number in the Start of Authority record:

$ORIGIN example.com.
example.com.     3600   SOA   ns1.example.com. admin.example.com. (
                            2021072701   ; serial YYYYMMDDnn
                            1800        ; refresh
                            3600         ; retry
                            86400       ; expire
                            3600 )      ; minimum TTL

The serial number in a zone file is written in this form: YYYYMMDDnn. YYYY is the year, MM is the month, DD is the day, and nn are two digits. Here, 2021072701 tells us that this zone was written on July 27th, 2021. It was the 1st edit of that day.

After you add records, make sure to increase the serial number to the correct day. If multiple edits are made on the same day, increase the two-digit number by one.

Then, run doas nsd-control reload to reload the zone files.

Test the Results

After you update the zone file, make sure to test that the record has been updated:

$ host subdomain.example.com
example.com has address
example.com has IPv6 address 2001:db8::


See the FQDN section.

Start of Authority

The start of authority record:

example.com.     3600   SOA   ns1.example.com. admin.example.com. (

ns1.example.com. needs to be replaced by the nameserver responsible for this zone. admin.example.com. means that the email for the sysadmin responsible for this zone is admin@example.com. Note that the @ ("at") symbol is replaced with a period.