Bind Zone Files

March 2021

$ORIGIN org.
$TTL 5m
example       IN    SOA (
                           20210326  ; serial
                           4h        ; refresh - wait between refresh attempts by secondary
                           15h       ; retry - retry failed zone refresh by secondary
                           8h        ; expire - expiration of secondary authority
                           4m        ; negative result TTL
              IN    NS
              IN    NS
              MX    10
              MX    20
              IN    TXT    "v=spf1 a mx -all"
              IN    NAPTR  10  100  "s"   "SIP+D2U"  ""
_sip._udp     IN    SRV    10  100  5060
_sip._udp     IN    SRV    20  100  5060
ns1           IN    A
ns2           IN    A
mail1         IN    A
mail1         IN    AAAA   2001:DB8::6
mail2         IN    A
www           IN    CNAME
p1            IN    A
p2            IN    A

A fully-terminated hostname has a dot on the end, like The $ORIGIN org. directive tells bind to append org. to any hostnames that appear after the directive that are not fully terminated. An $ORIGIN directive can be used more than once in a Bind config file, and affects all hostnames that appear after it (until the next $ORIGIN directive).

The $TTL 5m directive sets the default time to live for records in the zone. This is the time after which clients should ask again for a potentially updated record. Like $ORIGIN, the $TTL directive can be specified more than once in the same file.

The start of authority (SOA) record:

example       IN    SOA ( …

example is the hostname. We could have written this as, but the $ORIGIN directive will terminate the name with the TLD for us.

IN specifies the record type as “Internet”. Other record types are rarely used.