Skip to content

Local Zones

Write a zone, and this server answers those names itself. nas.home.arpa becomes the machine in the cupboard, and nothing about it leaves your house.

home.arpa is the name to use, and this server answers it whether or not you write a zone there. Without one, every name under it answers that the name does not exist. That is the answer the standard asks for, because no name under home.arpa resolves on the internet. Your zone replaces that empty answer for the names you write.

A zone is a directory under zones/ holding two files. zone.toml says what the zone is called. records.zone holds the records, as a master file of the kind BIND reads. Give the directory mode 750 and each file mode 640, which is what the other configuration files have. A large zone can put its records in more files, as A zone of several files says.

zones/
home-arpa/
zone.toml
records.zone
./data/config/zones/home-arpa/zone.toml
name = "home.arpa"
kind = "primary"
; ./data/config/zones/home-arpa/records.zone
$TTL 300
@ IN SOA ns.home.arpa. admin.home.arpa. ( 1 3600 600 604800 300 )
@ IN NS ns.home.arpa.
ns IN A 192.168.1.1
nas IN A 192.168.1.10
nas IN AAAA 2001:db8::10
printer IN A 192.168.1.20
files IN CNAME nas

Save both files. Write both before you save either, because a directory with one of the two files is a refused revision. The server notices the change and applies it, usually at once. If the file notification is lost, a check every 30 seconds finds the change instead. Then dig @127.0.0.1 -p 5300 nas.home.arpa A +short answers 192.168.1.10, with no restart. zones/<zone-id>/zone.toml: a name this server holds records for has the keys of zone.toml with their ranges. node.toml: what this machine does has the port this server listens on.

PATCH /api/zones/{id} changes the keys of zone.toml that a JSON object names, such as {"default_ttl": 600}, and keeps your comments. A key sent as null, such as {"default_ttl": null}, is taken out of the file, so its default applies. A key that the file does not hold is no change. name and kind are refused, also as null, because a zone with another name or kind is another zone. A key that zone.toml cannot hold is refused. A table, such as update, takes no null, and neither does a key deeper than one table yet. A change of a frozen zone is refused. A null that finds nothing to take out is no change, frozen or not. On a stub zone the route takes the keys of a stub, such as {"enabled": false} or {"primaries": ["192.0.2.10"]}. A key of a primary, such as default_ttl, is refused there, as the file of a stub refuses it. A stub whose id still holds the journal of a primary zone takes no change of its settings. That holds even for a change that changes nothing. The refusal says this stub holds the journal of a primary zone; delete the stub first, then make the zone again. Its deletion keeps the journal, so a stub made again under the id holds it too. It takes the settings of its POST /api/zones, and no PATCH after. This build has no way to delete that journal yet.

kind in zone.toml says where the records of a zone are. A zone without it is a primary.

  • primary: the records are yours, in records.zone and the other *.zone files of the directory. This server answers them itself, and every part of this page but the stub parts is about this kind.
  • stub: the zone is on other servers, such as an Active Directory domain, and this server knows their names and addresses. It asks those servers for a client that it resolves for. A static stub writes its servers in records.zone (A static stub zone). A stub with primaries learns them (A stub zone that learns its servers).

secondary reads, and the server does not serve it yet: a change that writes one is refused (A secondary zone). Any other word is refused as no kind of zone. A key of the other kind is refused too: [[update.allow]] and the defaults default_ttl, ns_ttl, serial, query_from, notify and transfer are keys of a primary. primaries, dnssec and rebind_protection are keys of a stub. tadoru zone list shows the kind of each zone that the server runs. A zone changes its kind, and a stub its source, in one revision: Changing the kind of a zone.

An owner, a lifetime, a class, a type, and the data. The lifetime and the class are optional.

nas 300 IN A 192.168.1.10

A name with no trailing dot is relative to the current origin, so nas means nas.home.arpa. A name with a trailing dot is whole, so ns.home.arpa. means exactly that. @ is the current origin, which is the zone’s own name until an $ORIGIN line moves it. A line that starts with a space or a tab takes the owner of the line above it.

A record can open with ( on the line before its owner. Where a blank or a comment follows the (, the next word decides. A lifetime, a class or a type there gives the record the owner of the line above, as this server has always read it. BIND reads that word as the owner. Any other word is the owner, as in BIND. So start such a record with its owner on the line of the (, or indent that line.

nas IN A 192.168.1.10
IN AAAA 2001:db8::10

$TTL 300 sets the lifetime for every line below it. A line with a lifetime of its own uses that one. Without a $TTL line, a line with no lifetime takes the last one another line stated, and the first such line is refused. A lifetime is a number of seconds, or numbers with units as BIND writes them: 1h30m, 2d or 1w. The letters w, d, h, m and s read in any case, and the numbers add up, as BIND reads them. The last number needs its letter, so 1h30 is refused. The server keeps the seconds, so 1h30m reads as 5400. The four timers of the SOA read the same units, as in ( 2024010101 1d 2h 4w 1h ).

$ORIGIN iot changes what a relative name below it means, to iot.home.arpa here. Write the name relative to the new origin after it. $TTL, $ORIGIN and $INCLUDE are the three directives this build reads. $TTL and $ORIGIN take one value each, and A zone of several files has $INCLUDE.

A ; starts a comment, to the end of the line. Inside a quoted string a ; is part of the string. The comment on the line where a record ends is the comment of that record, as The comment of a record says. Parentheses join a record across lines, which is what the SOA above uses. The class is IN, or CLASS1 which means the same, or nothing at all.

$INCLUDE reads another master file of the zone’s directory at the place of its line. Use it to split a large zone, for example one file for each subdomain.

zones/
home-arpa/
zone.toml
records.zone
iot.zone
; ./data/config/zones/home-arpa/records.zone
$TTL 300
@ IN SOA ns.home.arpa. admin.home.arpa. ( 1 3600 600 604800 300 )
@ IN NS ns.home.arpa.
ns IN A 192.168.1.1
$INCLUDE iot.zone iot
nas IN A 192.168.1.10
; ./data/config/zones/home-arpa/iot.zone
plug IN A 192.168.2.1
lamp IN A 192.168.2.2

The first value is the name of the file, in the same directory. The name ends in .zone, does not start with a dot, and holds letters, digits, -, _ and . alone. The second value is optional, and it is the origin of the included file. So plug above is plug.iot.home.arpa. Without a second value, the included file reads against the origin in force at the $INCLUDE line.

The origin and the owner come back after the included file. A $ORIGIN line inside it changes the origin of that file alone. An indented first line of the included file takes the owner from above the $INCLUDE line. So does an indented line after the $INCLUDE line. A $TTL line inside the included file holds for the lines below the $INCLUDE line too, as BIND reads it.

Includes nest 4 deep: records.zone can include a file, that file can include another, and so on for four levels. One zone reads 64 files and 32 MiB of text, records.zone and each include counted. An $INCLUDE of a file that is already open above it is refused, because it would read forever. One file can be included twice side by side, for example one template at two origins.

The server logs a warning for a *.zone file of the directory that no $INCLUDE line reads. That file is not served.

Twenty-three: SOA, NS, DS, A, AAAA, CNAME, DNAME, PTR, TXT, MX, SRV, HINFO, RP, NAPTR, APL, CAA, TLSA, SSHFP, SVCB, HTTPS, URI, DHCID and ZONEMD.

Type Holds Example data
SOA What the zone is, at the apex ns.home.arpa. admin.home.arpa. ( 1 3600 600 604800 300 )
NS A name server, at the apex or at a delegation ns.home.arpa.
DS The key of a delegated zone, at a delegation 12345 13 2 3E8A...5566, with the whole digest
A An IPv4 address 192.168.1.10
AAAA An IPv6 address 2001:db8::10
CNAME Another name this name is an alias for nas
DNAME Another name that the names below this one map to home.arpa.
PTR A name, for a reverse lookup nas.home.arpa.
TXT One or more strings "v=spf1 -all"
MX A preference and the host that takes mail for this name 10 mail.home.arpa.
SRV A priority, a weight, a port and the host of a service 0 5 5060 sip.home.arpa.
HINFO The hardware and the operating system of a host, two strings "ARM" "Linux"
RP The mailbox of the person responsible, and a name with TXT about them admin.home.arpa. info.home.arpa.
NAPTR A rule that rewrites a string into a name or a URI 100 10 "S" "SIP+D2U" "" _sip._udp.home.arpa.
APL A list of networks, each with ! where it is left out 1:192.168.0.0/16 !1:192.168.1.0/24
CAA A certificate authority that may issue for this name 0 issue "letsencrypt.org"
TLSA The certificate or key of a TLS server, for DANE 3 1 1 2BB183AF...4A3C, with the whole hash
SSHFP The fingerprint of the key of an SSH server 4 2 9D3E11F6...B2E1, with the whole fingerprint
SVCB Where and how to reach a service 1 svc.example.com. alpn=h2 port=8443
HTTPS Where and how a browser reaches a web site 1 . alpn=h3,h2 ipv4hint=192.0.2.1
URI A URI where a service runs, with a priority and a weight 10 1 "ftp://ftp1.example.com/public"
DHCID What a DHCP server keeps beside a name it set, in base64 AAIBY2/AuCccgoJbsaxcQc9TUapptP69lOjxfNuVAA2kjEA=
ZONEMD A digest of the whole zone, from its publisher, at the apex 2018031500 1 1 FEBE3D4C...47DE, with the whole digest

The SOA numbers are the serial, the refresh, the retry, the expiry, and the minimum, in that order. The refresh, the retry and the expiry are for a secondary server that copies the zone. They say how often it asks for the serial and how soon it asks again after a failure. They also say how long it keeps answering with no word from this server. This server does not act on them. The minimum is one of the two numbers that set how long a resolver remembers that a name is not there. The other is the lifetime of the SOA record itself.

The serial travels to clients, inside the SOA of every negative answer. A secondary server takes a new copy of a zone only where the serial is ahead of the one it holds. So raise it each time you change the records. An edit of a zone without an update rule can change the records while the serial does not move forward. Then the server takes the edit and logs a warning that names the zone: the records of the zone changed and its serial did not move forward. A change of the layout or the comments alone needs no new serial.

A TXT string holds 255 bytes at most. Write more than one string on the line for a longer value. Quotes hold a string with a space, a ;, a ( or a ) in it, and an empty string needs them too. A backslash in front of one of those characters does the same work as quotes. Inside quotes, write \" for a quotation mark. A word with none of those characters needs nothing.

A backslash at the very end of a file, with no line end after it, escapes nothing. A file that the server runs keeps loading: the server drops the backslash and logs a warning that names the file and the line. A new text of a .zone file that ends so is refused. Troubleshooting says what to change.

A backslash right before an LF (line feed) line end is refused in every file. Take a file with CRLF line ends, as Windows writes them. There a backslash right before the line end escapes the CR (carriage return) instead, and the word keeps the CR. The server reads such a file as before, and logs a warning that names the file and the line. A new text of a .zone file that holds one is refused.

Each of these types can also be written in the generic form of RFC 3597: \#, the length of the data in bytes, and the data in hex, in one word or several. nas IN A \# 4 C0A8010A is the address 192.168.1.10. The bytes are the record as it travels between servers, every name in full. The server reads them as that type, with every rule of the type. A length that does not match the hex, or bytes that are not a record of the type, is a refused revision.

An MX record with preference 0 and the host . is a null MX: it says that the name takes no mail (RFC 7505). It stands alone, so a null MX beside another MX at one name is a refused revision. An SRV record with the target . says that the service is not offered at that name. The flags of a NAPTR record hold letters and digits alone. A NAPTR record holds a regular expression or a replacement name, not both (RFC 3403). An item of an APL record is family 1 for IPv4 or 2 for IPv6. Then come an address, and a prefix of at most the bits of that address. The address has no bits set past the prefix. So 1:192.168.1.1/24 is refused, because the server would serve it as 192.168.1.0/24 (RFC 3123). The flags of a CAA record are 0, or 128 to mark the property as critical, and its tag holds letters and digits. The value of issue and issuewild is the domain name of an authority and parameters such as ; account=230123. The value of iodef is a mailto, http or https URL (RFC 8659). The three numbers of a TLSA record read as numbers or as names such as DANE-EE SPKI SHA2-256. The server writes them back as numbers. A number that has no name yet reads too, because a client skips a TLSA record it does not understand. A SHA-256 hash holds 32 bytes, a SHA-512 hash holds 64, and a full certificate or key holds at least one (RFC 6698, RFC 7218). tadoru zone tlsa prints the TLSA record for a certificate, so the hash comes from the certificate itself (tadoru zone). The two numbers of an SSHFP record are the algorithm of the key and the type of the fingerprint. Any number reads, because an SSH client skips a record for a key it does not hold. A SHA-1 fingerprint, type 1, holds 20 bytes, and a SHA-256 fingerprint, type 2, holds 32 (RFC 4255, RFC 6594). On the SSH server, ssh-keygen -r <name> prints the records of the host keys in /etc/ssh. ssh-keygen -r <name> -f <key file> prints the records of one key, one for each fingerprint type. A record that breaks one of these rules is a refused revision, in either form.

An SVCB or HTTPS record holds a priority, a target, and its keys in any order: key, key=value or key="value". The server writes the keys back in the order of their numbers. A key reads by its name, such as alpn, port, ipv4hint, ipv6hint, ech or dohpath, or as key and its number, such as key65000. The value of port, ipv4hint, ipv6hint and mandatory takes no backslash escape. Each key stands once. Outside AliasMode, every key that mandatory names stands in the record, and no-default-alpn needs alpn. A dohpath starts with / and holds the variable dns, as /dns-query{?dns} does (RFC 9460, RFC 9461). A record that breaks one of these rules is a refused revision, in either form.

A record with priority 0 is in AliasMode, and a client ignores its keys. The server serves such a record with its keys, and it logs a warning that names the zone and the owner.

An answer with an SVCB or HTTPS record carries what the same zone holds for the target, in its additional section. That is the A and AAAA records of the target and its records of the same type. A target that is an alias adds its CNAME and what the end of the chain holds. A target of . means the owner itself in ServiceMode, so the answer carries the owner’s addresses. In AliasMode it tells a client that the service is not available, so the answer carries nothing. A client takes that as advice and can still try to connect.

The target of a URI record stands in quotes, as RFC 7553 writes it, and a bare target reads too. It has no limit of 255 bytes. It is a URI. It starts with a scheme such as https:. It holds the characters of a URI alone, with % and two hex digits for any other byte, such as %20 for a space. An empty target, or one that is no URI, is a refused revision, in either form.

A ZONEMD record holds a digest of the whole zone, which the publisher of the zone puts at its apex (RFC 8976). Its data is the serial of the zone version that the digest covers, the scheme, the hash algorithm, and the digest in hex. The digest can stand in one word or several, inside parentheses across lines, in capitals or small letters. The scheme 1 is SIMPLE, and the algorithms 1 and 2 are SHA-384 and SHA-512. Any number reads. A digest of fewer than 12 bytes is a refused revision, in either form. The server writes the record back on one line, with the digest as one word in small letters. It serves the record as the file holds it, and makes no ZONEMD of its own.

A build before this one kept type 63 as bytes. So a zone file, or a file that an update of such a build wrote, can hold a line such as TYPE63 \# 5 0000000101, with fewer than 18 bytes of data: the three numbers take 6, and the digest 12 at least. This build refuses that line, at the next start too, and the message names the file and the line. Delete the line, or write a valid ZONEMD in its place. An update removes such a record only with a delete of the whole ZONEMD set of its name. Troubleshooting has the messages.

A zone can also hold ANAME records, which are not a type that travels between servers. A name with the addresses of another name says what they do.

A type with no row in the table goes in a zone in the generic form alone, under its number: TYPE18 for AFSDB, as in nas IN TYPE18 \# 7 0001 03616673 00. The server keeps its bytes and serves them as they came. Where the type holds a name at a known place, as AFSDB does, the bytes must hold one there. A line that writes such a type in a text form of its own is a refused revision, and the message names the generic form. dig prints a record of a type it does not know in the generic form, so you can copy it from there.

Two kinds of type are refused for their own reason, by their name and in the generic form, such as TYPE46 \# .... RRSIG, NSEC, NSEC3, NSEC3PARAM and DNSKEY records come from signing a zone, and a zone file does not hold them. OPT and the types from 128 to 255, such as AXFR and ANY, are a question type or the metadata of a message. TYPE0 and TYPE65535 are reserved. No record holds any of them as data.

An answer from a zone sets the AA bit. That bit tells the client this server holds the name itself, rather than the name of somebody it asked.

A name the zone holds without the type you asked for answers NOERROR with no records, and the SOA in the authority section. A name the zone does not hold at all answers NXDOMAIN, with the same SOA. The two are different answers, and a resolver caches them differently.

Terminal window
dig @127.0.0.1 -p 5300 nas.home.arpa MX +noall +authority # NOERROR, the SOA
dig @127.0.0.1 -p 5300 nothing.home.arpa A # NXDOMAIN, the SOA

A name that exists only because something below it does answers NOERROR with no records. With a.b.home.arpa in the zone, b.home.arpa is such a name.

How long a resolver remembers a denial is the smaller of the SOA’s own lifetime and its minimum. Lower the minimum while you are changing the zone, and raise it afterwards.

A question of type ANY over plain UDP gets one record set of the name. That is the smallest set, with its signatures where the client set the DO bit. Over TCP, DoT, DoH, DoQ and DoH over HTTP/3 it gets every set. A large answer to a small query over UDP lets a forged query flood somebody else. So the server keeps that answer small (RFC 8482). The same holds for an answer from the cache or an upstream.

Terminal window
dig @127.0.0.1 -p 5300 nas.home.arpa ANY # one set
dig @127.0.0.1 -p 5300 nas.home.arpa ANY +tcp # every set

An owner name can start with a star, written *. It answers for every name below it that no other line covers.

*.iot IN A 192.168.1.99

A query for bulb.iot.home.arpa answers 192.168.1.99, the same as lamp.iot.home.arpa or hall.bulb.iot.home.arpa. A name of your own wins over the star: add bulb.iot IN A 192.168.1.5, and that one name keeps its own address.

A star answers only in the exact place it sits. *.iot answers a name below iot.home.arpa. A different name you also wrote, such as kitchen.iot, does not share that star once it holds a record of its own. Write a star under kitchen.iot too for the same address there.

A star name that holds no record of the type you asked for answers NOERROR with no records, the same as an ordinary name.

The star must be the whole first label. *.iot works. iot.* and io*t do not: this server reads the star there as a plain name, and answers only a query for that exact text.

A CNAME record makes one name an alias for another, and this server follows it.

Terminal window
dig @127.0.0.1 -p 5300 files.home.arpa A +noall +answer
# files.home.arpa. 300 IN CNAME nas.home.arpa.
# nas.home.arpa. 300 IN A 192.168.1.10

Both records arrive in one answer, so the client asks once. Ask for the CNAME itself and you get the alias alone, because that is the question you asked:

Terminal window
dig @127.0.0.1 -p 5300 files.home.arpa CNAME +short # nas.home.arpa.

An alias can point out of the zone. Then this server answers the alias and resolves the target, and the answer holds both with the AA bit still set. Two cases stop at the alias: a client that cleared the recursion bit, and a server with no upstream configured. Both get the CNAME and no target records, which is a true answer rather than a failure.

A chain of aliases inside your zones follows 8 links. A longer chain is a refused revision, and so is a chain that arrives back where it started. The count crosses zones, so five links in one zone and four in another are nine. A chain that leaves your zones is not counted here. The answer to that part comes from the upstream in one message, whatever length it is.

An NS, MX, SRV or PTR record names a host, never an alias (RFC 2181). One whose target is an alias in your zones is a refused revision. An alias is a CNAME owner, a name that a wildcard CNAME covers, or a name below a DNAME owner (RFC 6672). Name the host that the alias points to. A target outside your zones is not checked.

An SVCB or HTTPS record in AliasMode, priority 0, works as a CNAME does for its type. A client follows it and ignores every other record of that type at the name. So a second record of that type beside it is a refused revision. Records of other types can stand beside it, such as the A record of the apex.

An NS record below the apex hands that name, and every name below it, to other servers. That point is a delegation. This zone then answers for those names only with where to ask.

lab IN NS ns.lab
lab IN NS ns.home.arpa.
ns.lab IN A 192.168.5.2
lab IN DS 12345 13 2 3E8A8FB6A1E2D9F8C9A0B1C2D3E4F5061728394A5B6C7D8E9F00112233445566

A client that asks for no recursion gets a referral for a name at or below lab.home.arpa. The referral holds the NS records in the authority section and the addresses of those servers in the additional section. The AA bit is clear, because the answer is not this zone’s own data. A DS question for lab.home.arpa is the one exception. The DS set is data of this zone, and the answer holds it with the AA bit set.

A client on the recursion list that sets the recursion bit gets the answer instead. It gets it the way it gets the answer for a name of no zone. A [[forward]] at or below the delegation sends the question to its own destination. So does one above the whole zone, such as in-addr.arpa above a zone for 168.192.in-addr.arpa. A forward inside the zone but above the delegation is refused, because the zone answers those names. Without one, the question goes to the forwarders, or to the walk from the root. The forwarders and the root cannot see a server inside your network. So a delegation to such a server needs a [[forward]] for its name, or the clients that ask with recursion get no answer. Sending some names to a resolver you choose has the forward.

A server whose name is inside the delegation needs an address in this zone, such as ns.lab above. A resolver needs that address before it can ask the server anything. The address of such a server is the only record that can sit below the delegation. A DS record can sit at the delegation, beside the NS records, and nowhere else. This server does not sign its zones, so a DS record here tells a validating resolver nothing about this zone.

A DNAME record maps every name below its owner onto the same names below another name. The owner itself keeps its own records.

old IN DNAME home.arpa.

A query for nas.old.home.arpa answers the DNAME, an alias from nas.old.home.arpa to nas.home.arpa, and the address of nas.home.arpa. The alias carries the lifetime of the DNAME. A name below the owner can hold no record of its own, because the mapping answers for all of them. A mapping that makes a name longer than 255 bytes answers YXDOMAIN, which says that the name cannot exist. Each DNAME counts as one link of the chain of 8 aliases.

An ANAME record gives a name the A and AAAA records of another name. Use it to point the apex of a zone at a host name that a provider gives you. A CNAME cannot stand there, because the apex holds the SOA and the NS records, and a CNAME owner holds nothing else.

@ IN ANAME lb.provider.net.
www IN CNAME lb.provider.net.

This server looks up the A and AAAA records of lb.provider.net itself. The apex answers with those addresses, owned by the apex, with the AA bit set. A query never waits for a lookup: it reads the last addresses.

After a lookup that succeeds, the server schedules the next one at nine tenths of the lifetime. The wait is one second at least and one hour at most. After a lookup that fails, it schedules a retry 30 seconds later, and the wait doubles after each failure up to five minutes. Sixteen lookups run at a time, so a lookup can start later than scheduled.

One name can hold up to eight ANAME records. The addresses of all their targets make one answer. One failed target fails the whole lookup, because a part of the addresses would hide the failure. The name then keeps its last addresses, as below, or answers Not Ready where it has none.

An ANAME is a record of this server alone. No standard defines it, and it has no type number. A client cannot ask for it, and no answer carries it. A zone file that holds one is for this server alone.

The server looks up a target as itself, not as a client. No blocklist, no client group and no recursion list applies to that lookup. So the name gives its addresses to every client that can read the zone, also where those clients cannot ask for the target themselves.

Question at the name Answer
A or AAAA The addresses of that family. No records and the SOA where no target has one
ANY The records and the addresses of both families, one set over UDP
Any other type The records of the name, as for any other name

While the name has no set of addresses, A, AAAA and ANY answer SERVFAIL with Extended DNS Error 14, Not Ready. That is so in four cases:

  • Before the first lookup succeeds.
  • After a change of the ANAME records of the name, until a lookup succeeds.
  • After a change of the rebinding settings while the check is on, until a lookup succeeds.
  • After a change that its last lookup would now break, until a lookup succeeds. These changes break it:
    • a narrower allow_recursion or encrypted_allow_recursion;
    • an encrypted listener, a [[forward]] or a stub zone on the way;
    • a wider query_from of its zone;
    • a delegation that puts a name on the way behind a forward. A dynamic update that adds such a delegation counts too.
  • One day after the last lookup that succeeded.

A lookup that succeeds with no address of a family gives a set too. That family answers with no records and the SOA. Troubleshooting says why a name stays Not Ready, and which metrics and log lines show the lookups.

The lifetime of an answer is the smallest lifetime of its sources. The sources are the ANAME records, each alias on the way to a target, and the addresses. The answer that says a target has no address of a family is a source too. While the addresses are fresh, that lifetime counts down. So a client keeps them no longer than their source allows. Past it, the addresses answer with a lifetime of zero for up to 30 seconds, while the next lookup has time to end.

The addresses become stale in two cases. A lookup failed, and their lifetime ended. Or their lifetime ended, and no lookup replaced them within those 30 seconds. A lookup that the server skipped for want of a place leaves them stale too, with no failure in the log. Stale addresses answer with a lifetime of 30 seconds. The name keeps them until one day after the last lookup that succeeded.

A target can be in your zones or outside them. A target outside them needs a route: a [[forward]] that covers it, forwarders, or resolution = "recurse". A target at or below a delegation of your zones needs one too, unless a deeper zone of this server answers it. So does a target that a CNAME or a DNAME of your zones leads out of them. Then the name where the chain leaves your zones needs the route.

A lookup that has to ask outside needs a free place in half of max_concurrent_resolutions. Where none is free, the lookup stops and tries again a second later, then later each time. With that setting at 1, no place is left. An answer from your zones or from the cache needs no place.

An answer from outside goes through the rebinding check, as the answer to a client does. With rebind_protection on, a target whose outside answer points into your network fails its lookup. rebind_allow excuses a target that it names. A [[forward]] with rebind_protection = false excuses the answers it gives.

Each lookup also checks who may read what it found, on every name on the way to the target. A name in one of your zones must be in a zone whose query_from covers the query_from of the zone of the ANAME. A name that a [[forward]] or a stub zone answers needs the query_from of the zone of the ANAME inside allow_recursion. It needs it also inside encrypted_allow_recursion where this node has an encrypted listener. Inside means inside the clients that the list allows, after its deny entries. With allow_recursion = ["10.0.0.0/8", "!10.1.2.0/24"], a query_from of 10.1.0.0/16 is not inside, because 10.1.2.0/24 is a hole in it. A name at or below a delegation of your zones counts by the [[forward]] or the stub zone that answers it. Otherwise the lookup fails. The name drops its last addresses and answers Not Ready until a lookup passes, because they came by a way that the rule now refuses. So an outside alias that changes to point into a narrower zone hands nothing on. A lookup that fails for any other reason keeps the last addresses, stale, for up to a day after the last lookup that succeeded.

A wildcard ANAME, such as *.cdn IN ANAME lb.provider.net., gives every name it covers the same addresses. The owner of each answer is the name that was asked for.

Each of these is a refused revision:

  • An A, AAAA or CNAME record at a name that holds an ANAME. The ANAME is the source of both address types.
  • An ANAME at a delegation, below one, or below the owner of a DNAME.
  • More than eight ANAME records at one name, or more than 1,000 names with an ANAME in all your zones.
  • A target that leads to a name with an ANAME: such a name itself, or a name that a wildcard ANAME covers. A CNAME or a DNAME of your zones that leads to one counts as well.
  • A target, or the name where its chain leaves your zones, on a server with no route for it.
  • A target, or the name where its chain leaves your zones, that a [[forward]] or a stub zone answers. It is refused where the query_from of the zone of the ANAME is not inside allow_recursion. It is refused also where query_from is not inside encrypted_allow_recursion and this node has an encrypted listener.
  • An ANAME in the generic form, \# and the data in hex, because the type has no number.

Troubleshooting has each refusal, and what to do.

RFC 8375 reserves home.arpa for exactly this. Nothing on the internet can ever hold it, so a zone for it collides with nothing and leaks nothing.

Avoid a name somebody else owns. A zone for example.com cuts your house off from the real example.com, and from every part of it you did not think about. Avoid a made-up top level such as .lan, .home or .local as well. Those are not reserved, .local belongs to multicast DNS, and a new top level domain can take any of the others.

If you own a name, use that. A subdomain of it, such as h.example.org, leaves the rest of the domain to the internet.

Some names never reach the internet, because no resolver out there holds a true answer for them. This server answers them itself.

Name What it answers
localhost, and every name under 127.0.0.1 and ::1. Any other type is NOERROR and empty
test, invalid, local, onion NXDOMAIN, the name itself included
home.arpa NOERROR and empty, until you write a zone for it
resolver.arpa, and every name under NOERROR and empty, but for the encrypted listeners at _dns.resolver.arpa. The name itself holds its SOA and NS
The private reverse ranges The same. local_zones = false sends these upstream

Four names answer that the name is not there, the name itself included. test and invalid are reserved for names that resolve nowhere. local belongs to multicast DNS and onion belongs to Tor, so a program asking this server for one of them is asking the wrong place. Being told the name is absent sends it to the right one.

home.arpa and the reverse ranges answer that the name is there and holds nothing, which leaves room for the zone you write for it.

resolver.arpa is where a client asks for the encrypted endpoints of the resolver it uses, which is this server. A question for _dns.resolver.arpa of type SVCB names the encrypted listeners of this server, where tls_server_name names a host. Telling a client about the encrypted listeners says when. Every other question under the name finds a name that is there and holds nothing.

Every negative answer here carries the SOA of the built-in zone, so a resolver knows how long the absence holds. None of these names sends a query off this machine, unless you point a forwarder at one of them yourself.

Your own zone takes over any of them except three. You cannot write a zone for localhost, for onion, or for resolver.arpa. Troubleshooting says why for each.

The blocking test runs before the zone lookup, so a name your lists block is blocked even where a zone holds it. The query log row names the rule, as long as the log stores names. Blocking has the lists and the allow entries, and an allow entry for that name gives the zone its answer back.

A server that answers the internet and holds home.arpa must not answer the internet from that zone. The default of query_from holds the private ranges alone, so a zone that writes no list already answers your house and nothing else. Where the networks of your house are not all private, name them yourself, such as the IPv6 prefix of your provider. Write them in the [zones] table of server.toml (Defaults of a zone):

[zones]
query_from = ["192.168.1.0/24", "2001:db8:1234::/48"]

A client outside the list gets REFUSED for every name of your zones. The refusal over UDP looks the same as the refusal of a client outside allow_recursion. A name of your zone is never sent to your forwarders for such a client, so it stays inside your network. A name under home.arpa or a private reverse range gets the answer that the server gives where you wrote no zone. A name that a [[forward]] covers goes to that forward. An update from a sender outside the list is refused as well. A zone can set its own query_from in its zone.toml, which wins over the table. So a public zone and a private one can sit on the same server. A zone of yours can sit below another zone of yours. A DS question for the lower zone is then answered from the upper zone only to a client in both lists. The DS set tells whether the lower zone is signed. Any other client gets the answer of a client outside the list. A zone of yours above a narrowed zone does not answer for it. An alias from a public zone into a narrowed one stops at the narrowed one, with REFUSED.

The list hides the records of a zone, and not every trace of the zone:

  • A client on allow_recursion and outside query_from still gets the blocking answer. That holds for a name your lists block, the canary name and the Private Relay names. The blocking test runs before the zone, as the section above says, and its answer comes from the lists rather than the zone.
  • Such a client learns that the zone exists, because a name of it gets REFUSED where any other name gets an answer.
  • The check that keeps outside answers from pointing into your network reads every zone, whoever asks. A client with recursion can publish an alias of its own that leads into your zone. A SERVFAIL then tells it whether a name there holds a private address.
  • An outside answer whose names lead into a zone that the start stopped gets SERVFAIL, whoever asks. The same alias then tells such a client whether your zone is stopped.

So a zone whose names must stay unknown to a client needs that client off allow_recursion as well.

A program can change the records of a zone with a DNS message, an update (RFC 2136). A DHCP (Dynamic Host Configuration Protocol) server sends one to register the name of a laptop. nsupdate sends one from a script. A zone takes no update until its zone.toml allows it. Without a rule, the server refuses every update.

Write one [[update.allow]] rule for each sender. A rule names the networks the sender comes from, the names it can change, and the types of record it can change. Updates: [[update.allow]] has every key, its range, and the checks on the rule.

# zones/home-arpa/zone.toml, below the name and the kind of the zone
[[update.allow]]
from = ["192.168.1.2/32"] # the DHCP server
names = ["*.dhcp.home.arpa"]
types = ["A", "AAAA", "TXT", "DHCID"]
udp = true
  • udp is false unless the rule says true. A rule without it takes an update over TCP (Transmission Control Protocol, RFC 9293), DNS over TLS and DNS over QUIC alone. An update over DNS over HTTPS is always refused. So is an update over UDP that comes through a load balancer with a PROXY header, whatever client the header names.
  • Kea, ISC dhcpd and Windows DHCP send updates over UDP (User Datagram Protocol, RFC 768). So the rule of a DHCP server needs udp = true. Keep such a rule to one address and to the names below one name, as the example does.
  • Every record of the update must be inside a rule that names the sender. A deletion of every set at a name needs a rule for each type that the name holds.
  • No rule by address covers the SOA record or the NS set at the apex, whatever types says.

The server checks the rules again when the update reaches its zone. A rule that you narrow while an update waits refuses that update.

An update is applied whole or not at all. The answer repeats the zone section of the update and carries a response code. NOERROR means that the change is in the journal on the disk, and an update that changes nothing gets it too. Any other code means that nothing changed. Troubleshooting has the table of every code, what it means, and what to do about it.

A sender that no rule names gets REFUSED, never NOTAUTH or code 18. So a stranger cannot learn which zones this server holds. A serial that the update did not set moves forward by itself, once for each update that changes the zone. It moves by the scheme that serial names in the zone’s zone.toml, and else in the [zones] table of server.toml: increment by default, or unixtime or date (Defaults of a zone). A zone with more than a hundred updates a day keeps increment, because date then runs ahead of the calendar.

The query log holds a row for each update, with kind set to update (The query log).

Each update that changes a zone is one transaction in the file zones/<zone-id>/updates.jnl in the state root. The server writes it to the disk before it answers NOERROR, so a crash a moment later loses nothing. The journal is not text for you to edit. The server prunes it. Once the checkpoints leave many transactions behind that no kept revision needs, it drops them. It writes the rest to updates.jnl.prune before it renames that file over the journal. A backup archive carries no journal (Backup and restore). If the journal is lost or damaged, the zone stops, and Troubleshooting says how to bring it back.

records.zone does not change on every update. A checkpoint runs when the journal of a zone grows past a limit. It runs also five minutes after the last change of a zone without an update policy. It writes the zone into records.zone as a new revision. Troubleshooting has the numbers. The checkpoint keeps the comments and the layout of the file where it can. Where it cannot, it writes the zone whole, and the log says that the layout was not kept. A backslash right before a CRLF line end is written as \013 in place, so the word keeps the CR. An update that arrives while the checkpoint runs waits for it. A hand edit of the records of a zone with an update rule is refused. So is one of a zone whose changes wait for the checkpoint. The next section says how to edit such a zone.

A zone with an update rule keeps its newest records in its journal, so records.zone can lack them. An edit of the file by hand would start from old records. The updates replayed over it could come twice or bring back a record that you deleted. So the server refuses a hand edit of the records of such a zone. Three edits count: a save of a *.zone file, a new or a deleted *.zone file, and a new name in zone.toml. It refuses it from an editor, tadoru config edit, tadoru config apply and tadoru zone import --replace alike. A change of the rest of zone.toml, such as an update rule, is taken. Edit such a zone in three steps, with the server stopped:

Terminal window
tadoru zone freeze home-arpa
# Edit the files under zones/home-arpa/ in the configuration root, and raise the serial.
tadoru zone thaw home-arpa

The freeze writes the updates of the journal into records.zone, so the file holds the whole zone. From then on the zone answers queries as before. It answers REFUSED to an update, with code 18 and the text zone frozen over a connection. It takes no checkpoint, and takes no change of its files from a command. A command that changes one of its files, deletes the zone or rolls back over its files is refused. The message says to edit the files in the configuration root and thaw. A save of a file of the zone waits, and the zone keeps serving its old records.

The thaw reads the files, checks them, and makes them the zone in one new revision. Where the records changed, the serial in the SOA record must be ahead of the serial of the freeze. Then a secondary takes the change. tadoru zone thaw --serial-bump raises it for you and keeps the rest of the file as you wrote it. A file that does not read is refused with its line, and the zone stays frozen until a thaw goes through. The serial must also be ahead of the last serial that the zone served, which The serial says more of. tadoru zone has both commands, and Troubleshooting has each refusal.

A freeze lives in the journal of the zone. The freeze can be lost with the journal. That happens where the journal is lost or does not read to its end. It happens also where the journal was replaced by a cut or a remake that could not read the old one. The server cannot tell. So the next start stops the zone as freeze-uncertain, and keeps an edit of its files waiting in the configuration root. This lasts until you state whether the zone was frozen:

Terminal window
tadoru zone journal settle-freeze home-arpa --not-frozen
tadoru zone journal settle-freeze home-arpa --frozen-at 7

--frozen-at takes the serial at the head of the journal, and writes the freeze again there, so the thaw ends it as usual. Where the journal ends in that freeze already, it writes no frame and records the statement alone. The freeze state of a zone is not certain says how to tell which.

A zone without an update rule takes a hand edit at once. Where a change through the API or an ACME challenge waits for its checkpoint, the hand edit is refused. It is refused for those five minutes, or until you freeze the zone. A crash can do the same, where the server stopped after it wrote the serial witness of a change and before the change itself. The next start moves the serial of the zone past the serial witness with an entry in the journal of the zone, and a hand edit is then refused until its checkpoint, five minutes after it. An edit that changes the records and keeps the serial, or writes a serial behind one that the zone served, is taken. Its serial moves past the serial that the zone served, as The serial says.

Do not rename the directory of a frozen zone. While its directory is gone, every new zone directory waits and a command that makes a zone is refused. The thaw names the new directory and asks you to move it back. With the server stopped, move it back, thaw, then rename it. Thaw a zone before you restore a backup, too: tadoru restore --yes refuses while a zone is frozen.

A rule by address trusts a network. It does not prove who sent the update. Over UDP a sender can forge its address. Over TCP the connection proves only that the reply reaches that address. Any program on that machine, or behind the same NAT (Network Address Translation, RFC 3022), can send an update. A forged update from the address of your DHCP server can write every name that the rule covers. So keep each rule narrow, and allow UDP only for a sender that needs it. This build has no TSIG (transaction signatures), which would prove the sender with a shared key. TSIG comes in a later version.

A secondary server follows a zone by the serial in its SOA record. It takes a serial only where it is ahead of the one that it holds. So the server holds each zone to two rules:

  • A serial never goes back. Each serial that the zone serves is ahead of the one before, by the arithmetic of RFC 1982.
  • One serial names one set of records. A change of the records always comes with a new serial.

It keeps the serial witness in serials.sqlite in the state root for that. The witness holds the name of each zone, its apex, the first and the last serial that it served, and a digest of its records. Every change counts from it, whatever zone id serves the apex. These are a dynamic update, a change through the API, a hand edit, a thaw, a rollback and a restore. Where a change would serve a serial that is not ahead, the server moves the serial past the one that the zone served. It uses the serial scheme of the zone. It logs moved the serial of a zone past the serial it served. A command with the server stopped, such as an offline rollback, holds no witness. It keeps its serial, with a warning where the serial cannot move. The next start moves it past the witness. A hand edit that keeps the serial, or writes one behind, gets the moved serial back in its own records.zone. So you need not change the serial again. A hand edit that writes a serial ahead serves as written.

serial of zone.toml names the scheme of a zone: increment, unixtime or date. A zone whose file names none takes zones.serial of server.toml, which Defaults of a zone describes. A new zone can name its scheme when you make it:

  • POST /api/zones takes "serial": "date" in its body. The new primary writes the key into its zone.toml. Its first serial is the first step of that scheme from 0: 1 under increment, today’s YYYYMMDD00 under date, and the time under unixtime. The date or the time is the first serial only where it is ahead of 0 by the arithmetic of RFC 1982. Where it is not, the first serial is 1, such as at the Unix time 2^31 under unixtime. A stub moves no serial, so a stub with serial is refused as invalid-zone.
  • PUT /api/zones/{id}/import?name=home.arpa&serial=date writes the key into the zone.toml of the zone that it makes. The SOA of the file keeps its serial, and the scheme moves it at the next change. serial without name is a 400, because a replace keeps the zone.toml of the zone.

Without serial, each route writes no key, as before. PATCH /api/zones/{id} with {"serial": "date"} changes the scheme of a zone that exists.

The serials of one history stay inside 2^31 of its first serial, the reach of RFC 1982. A zone whose serial cannot move inside that bound stops. It answers SERVFAIL until tadoru zone witness reset <apex>, with the server stopped, starts its history again on purpose. A secondary then needs a fresh transfer of the whole zone. Where less than an eighth of that room is left, the server logs a zone has used most of its serial space. A history near its end says what to do.

GET /api/zones/{id} answers the row of the apex of the zone: served_serial, the last serial that it served, and first_serial, the first serial of its history. A zone with no row has neither. The serial witness lists the metrics of the witness: the moves, the zones that it stops, its writes and its rows.

A thaw keeps the serial ahead of the witness as well. tadoru zone thaw --serial-bump moves the serial past it with no change of a record. A thaw with no --serial-bump whose serial is behind it is refused, and names the serial that --serial-bump writes. Where no thaw from the serial of the freeze can reach past the witness in one step, the thaw is refused with its way out. The way out is the same thaw with the server stopped. After it, the next start moves the serial past the witness.

Where the witness cannot say which serials a zone served, the zone stops until a command of tadoru zone witness names it. That happens after the file is lost, and after a restore onto a new machine. A zone that the serial witness stops says what to run.

A secondary server, such as BIND, can copy a zone of yours and answer for it too. It asks this server for a zone transfer, AXFR, which sends the whole zone over plain TCP (RFC 5936). No address can transfer a zone until a rule names it, loopback included:

# zones/home-arpa/zone.toml, below the name and the kind of the zone
[[transfer.allow]]
from = ["192.168.1.53"]

The rules of [[zones.transfer.allow]] in server.toml cover every zone that names none of its own. Defaults of a zone and Transfers: [[transfer.allow]] have both, with their bounds and their warnings. A client can transfer a zone only where all three hold:

  • A rule of the zone names its address.
  • Its address is inside the query_from of the zone.
  • Its address is inside the query_from of each zone of yours below this one, at a delegation or not. A transfer holds every record of the zone, the records below such a zone included. So a client that one of them refuses is refused the whole transfer.

A transfer sends every record that the zone serves, at the serial of its SOA record, which comes first and last. A record turned off with ;off does not go. The transfer reads one version of the zone from its start to its end. So a change of the zone while it runs goes in the next transfer. The serial of the zone moves with every change of its records, as The serial says. So a secondary that polls the SOA record sees each change.

These zones do not transfer:

  • A zone that holds an ANAME. A secondary cannot read an ANAME, and the addresses that it gives change with no new serial. The transfer gets REFUSED, with the text the zone holds an ANAME, which no transfer carries.
  • A stub zone, a zone that is turned off, and the zones that the server answers itself, such as localhost. They answer as a name outside every zone: REFUSED.
  • A zone that is stopped, such as a zone that the serial witness stops. While it is stopped, its transfer gets SERVFAIL, as every other name of the zone does.

An incremental transfer, IXFR, asks for the changes since the serial of the secondary (RFC 1995). The server keeps in memory the changes that each zone published since the server started, an update or a hand edit alike. A secondary at a serial that this server served since its start gets the changes from that serial alone. Where the secondary already holds the serial of the zone, or a newer one, the answer is the SOA record alone. Any other secondary gets the whole zone, in the form of an AXFR:

  • After a restart. The server starts with no changes kept. So a secondary behind the zone gets the whole zone once, and the changes again after the next one.
  • When the changes from its serial are no longer kept. A zone keeps up to 1,000 changes, and never more than the size of the whole zone. All zones together keep at most 64 MiB of them. A zone also starts again with no change kept in four cases. These are when its serial moves past a serial that it served, and when it is stopped or turned off and comes back. They are also when it moves to another apex, and when a change does not fit those limits.
  • A zone too small to keep a change. A change fits only where the zone holds at least two SOA records and twice the octets that the change deletes. So a zone of an SOA, one NS record and one A record sends the whole zone for every IXFR.
  • After tadoru zone witness reset, accept or raise, which start a new history of the apex. Its serials can reuse those of the old history, which a secondary can still hold with other records. So every IXFR of the apex gets the whole zone, a secondary at the serial of the zone included. This lasts until two things are both true. First, the time that the command printed passed. Second, the zone served a serial ahead of every serial that a secondary can still hold of the old history. The time ends at the next change that the zone publishes after both are true. A secondary at the serial before that change gets it alone. A restart after both are true ends it too. tadoru zone witness list names both bounds. The log says an apex sends whole zones after a new history once, when the apex first serves inside that time.

Over UDP, an IXFR gets the SOA record alone, and a secondary behind the zone then asks again over TCP. Inside that time after a new history, the answer over UDP has the TC bit and no record. So the secondary asks over TCP and gets the whole zone. No change goes over UDP.

Give one zone one primary. A secondary that takes a zone from two servers can hold a serial of the other server, with other records under the same number. It then takes the changes of this server onto the wrong records. No server can tell. A cluster of servers sends whole zones for every IXFR.

A transfer goes over plain TCP alone. DNS over TLS, HTTPS and QUIC refuse it. A rule trusts the network of an address, and is no proof of who sent the request: TCP proves that the reply reached the address, and not which program on that machine asked. So keep this server and its secondaries on a network that you trust, such as a VPN between them. This build has no signed transfer and no transfer over TLS.

Each client gets a share of the server. One address runs at most 2 transfers at once and starts at most 6 a minute. One range, a /24 of IPv4 or a /56 of IPv6, runs at most 2 at once and starts at most 12 a minute. The server runs at most 10 at once. One address takes at most 1 GiB of transfers an hour, and one transfer runs for 10 minutes at most. A transfer past a limit gets SERVFAIL, and the connection goes on. A zone transfer that is refused has each refusal.

Test a rule from the machine of the secondary, with the address that the rule names:

Terminal window
dig axfr @192.168.1.2 home.arpa

The answer lists every record of the zone, with the SOA record first and last, and ends with a line such as ;; XFR size: 12 records (messages 1, bytes 412). A client that the rules refuse gets ; Transfer failed. and no record.

A zone with a notify list tells each secondary of the list that it changed (RFC 1996). The secondary asks for the SOA record of the zone at once. It transfers the zone where the serial is new, rather than at the refresh time of the zone. notify names the secondaries, in zone.toml or in [zones] of server.toml (NOTIFY: notify). With no list, the server sends no NOTIFY.

A NOTIFY goes out:

  • at each change of the serial of a primary zone of yours that is on and serves. A change of the times of records alone keeps the serial, and sends nothing;
  • at each start, to each secondary of each such zone, because the server keeps no record of what it sent before;
  • when a revision adds a secondary to a list, turns a zone on, or lets a zone that the serial witness stopped serve again.

A zone that holds an ANAME sends none, because no transfer of it can follow.

Each NOTIFY goes over UDP, after a random wait of up to a second. It goes again after 2, 4, 8, 16 and 32 seconds where no answer comes, 6 copies at most in about 2 minutes. An answer must carry the question of the NOTIFY, and the RA bit must be clear. A secondary that does not answer gets no more copies of that change. It learns of it at its refresh time, and the next change notifies it again.

The server spaces its NOTIFY near the limits of a transfer, so that a secondary does not ask for more transfers than it may start. One address gets at most 2 at once, then one each 15 seconds. One range gets one each 6 seconds. A NOTIFY never waits longer than the REFRESH of its zone. This spacing is best effort. The secondary can transfer from another address, or its own refresh can use a start, so a transfer can still get SERVFAIL at a limit. The secondary then asks again at the RETRY of the SOA record, 15 minutes by default.

A secondary takes a NOTIFY only from an address that it knows as a primary of the zone. The source address follows outbound_addresses of node.toml:

  • an empty list lets the system pick the source address, as for every query of this server;
  • a list with addresses sends from the first of them in the family of the secondary;
  • a list with no address of that family sends nothing to that secondary, and a revision warns;
  • an address of the list that cannot be bound sends nothing. The server never falls back to another address.

A NOTIFY that is under way when a revision changes outbound_addresses keeps its source until it ends. For BIND, put the address of this server in primaries of the zone. The log says notified a secondary at the first answer of each secondary after a start. A secondary does not hear of a change has each line that says it did not work.

Changing the records of a zone through the API

Section titled “Changing the records of a zone through the API”

POST /api/zones/{id}/records changes the records of one zone with no update rule. An account with the role operator or admin sends it, or the user that the server runs as, or root, on the socket. The body states the records that you want, in seven lists. These are add, remove, turn_off and turn_on. set_ttl is for the lifetime of a whole set. replace is for the sets to replace. notes is for the comment and the expiry time of a record. Each line is one record as GET /api/zones/{id}/records gives it, with every name absolute:

Terminal window
S=./data/run/api.sock # as the user that the server runs as, so no credential is needed
ETAG=$(curl -s -D - -o /dev/null --unix-socket $S \
'http://localhost/api/zones/home-arpa/records?limit=1' | awk 'tolower($1) == "etag:" {print $2}' | tr -d '\r')
curl -s -X POST --unix-socket $S -H 'content-type: application/json' \
-H 'idempotency-key: add-www-1' -H "if-match: $ETAG" \
-d '{"add": ["www.home.arpa. IN A 192.168.1.20"]}' \
http://localhost/api/zones/home-arpa/records

It differs from an update in what a line means. An update can pass over a record and still answer NOERROR. Here each line acts where the zone is not yet as it says, and is in effect where it is. A line that the zone cannot take refuses the whole request, which names the line. So the same request again changes nothing.

Two headers make it safe to send again. Idempotency-Key names the change, and a request again with it gets the first answer for 24 hours. If-Match takes the ETag of the records that you read, so a change made while you looked is a 409, and nothing is lost. The change goes into the journal of the zone, as an update does. API Reference has every field, and Troubleshooting says what each refusal means.

replace names a set by its owner and its type. Each record that the zone serves in the set leaves it. The exception is a record that a line of add, remove, turn_off or turn_on of the same request names. So add and replace of one set make the set hold exactly the records of the adds:

{
"add": ["www.home.arpa. 300 IN A 192.168.1.20", "www.home.arpa. 300 IN A 192.168.1.21"],
"replace": [{ "owner": "www.home.arpa.", "type": "A" }]
}
  • A replace is in effect where the set already holds only the records that the request names, at the lifetime that the request gives it.

  • The lifetime of a replaced set comes from the first of these that applies:

    • its set_ttl item;
    • its adds that state one, which must agree;
    • the lifetime that the zone served it with;
    • the default of a new set.

    So an add with a lifetime gives the replaced set that lifetime.

  • The records of the set that the zone holds turned off stay off. Only remove deletes one.

  • A record whose data changes is another record, and it starts with no notes. To keep the comment and the expiry time of the record that it replaces, read comment and expires_at from GET /api/zones/{id}/records. Send them in notes for the new record in the same request. A file can hold a comment that a note does not take. One is past 1,024 octets. One has a control character such as a tab. One has a later word that starts with ;refreshed= or ;expires=. Such a comment is comment-form, so shorten or edit it before you send it. An expiry time at or before the time of the change is expiry-time, so leave the time out.

  • A replace of the SOA is soa, of an ANAME aname, and of a type that a signer makes signer-type. A set in two items is named-twice.

notes sets the comment and the expiry time of a record that the request leaves in the zone, served or turned off. record names the record as a removal does, with or without its lifetime:

{
"notes": [{ "record": "www.home.arpa. IN A 192.168.1.20",
"comment": "the web server", "expires_at": 1796083200 }]
}
  • Each field works the same way: absent keeps it, null clears it, and a value sets it. expires_at is in seconds since 1970.
  • A note is in effect where the record already has those notes. A change whose only lines that act are notes keeps the serial.
  • A comment is 1 to 1,024 octets of UTF-8. It has no control character, no blank at either end, and no word that starts with ;refreshed= or ;expires=. Else it is comment-form.
  • An expiry time needs a zone with record_expiry (expiry-off). A time past 9999-12-31T23:59:59Z, and a time that the note changes to one at or before the time of the change, are expiry-time. A change that leaves no NS record of the apex without an expiry time is apex-ns-expiry.
  • A note of a record that the request does not leave in the zone is absent. A record in two notes is named-twice.
  • A note of the SOA is soa, of an ANAME aname, and of a type that a signer makes signer-type.

The answer gives one outcome for each item of replace and of notes, as for the other lists, in outcomes.replace and outcomes.notes. Each of the two is left out where the request holds no item of it. The 1,000 items of one request count all seven lists.

POST /api/zones/{id}/records/import merges the records of a zone file into a zone that exists. The body is the text of the file, with the apex of the zone as its origin, so www is www.<apex>. It needs an Idempotency-Key, and takes If-Match, as a change of records does. With S set as above:

Terminal window
curl -s -X POST --unix-socket $S -H 'idempotency-key: merge-1' \
--data-binary @more.zone http://localhost/api/zones/home-arpa/records/import
  • Each record of the file is an add. Its lifetime is the one that the file gives it: its own, that of $TTL, or the last one stated. A file whose first record has no lifetime and no $TTL before it is refused.
  • The SOA records of the file and its records turned off are skipped and counted. The zone keeps its own SOA, and a merge adds served records alone.
  • A record that the zone does not serve takes the comment and the expiry time that the file gives it. Without replace, a record that the zone serves keeps its own notes.
  • With ?replace=true, each set that the file names ends as the file states it. A record of the zone in such a set that the file does not hold leaves. Its records turned off stay off. Each record takes the notes of the file, an absent one cleared.
  • The file holds 10,000 records at most, and the merge stays within one transaction of the journal. The body is 1 MiB at most. An $INCLUDE line is refused.
  • The merge goes into the journal as one transaction, and moves the serial once. A merge of notes alone keeps the serial.

The answer counts what the merge did: added, the records of the file that the zone did not serve; removed, the records that replace took away; in_effect, the records that the zone served already; and skipped. A merge in which nothing acts is unchanged, and its key keeps that answer. The same key with the same file and the same replace gets the first answer for 24 hours. A refusal that one record caused names the line of the file where it starts in line, with list set to file. A merge of a zone file that the API refuses lists the refusals.

enabled = false in zone.toml turns a zone off without deleting it. The zone stays in the configuration with its journal. The server still reads and checks its own records, so a mistake in them is still refused. The checks between zones and against server.toml run when you turn it on again, so that change can be refused. It answers no name and takes no update. A name of it goes to whatever else holds the name. That is a zone of yours above it, a [[forward]], the upstream, or a zone that this server holds itself. So turning off your zone at home.arpa brings back the empty home.arpa that this server answers when you hold none. Records of a zone above it that the zone hid are served again. They must pass the rules of the zones, such as no MX target at an alias. tadoru health names a zone turned off, and tadoru zone list shows it with off and the reason.

With the server running, tadoru zone disable home-arpa sets enabled = false for you, as one revision. tadoru zone enable home-arpa turns the zone on again. Both turn a stub zone off and on too, as PATCH /api/zones/{id} with {"enabled": false} or {"enabled": true} does. An edit of a stub’s files by hand is refused while the stub runs, and the refusal names the ways a stub changes. tadoru zone has both commands.

Write ;off and a space before a record to turn it off without deleting it:

nas IN A 192.168.1.10
;off nas IN A 192.168.1.11
www IN A 192.168.1.80

The server reads the record after the mark and keeps it, but does not serve it. The record answers no question and makes no name exist. It also counts for no rule. An NS record turned off at the apex is no NS record of the zone. A CNAME turned off is no alias. It still counts toward the limit of records of a zone. BIND and other servers read the line as a comment, so the record is off there too. To turn the record on again, delete ;off and the space at the start of the line.

The mark is the exact text ;off and a space, at the start of the line or after blanks. ;OFF, ; off, and an ;off after a record on the same line are comments. The rest of the line holds one whole record: write its owner, and close a parenthesis on the same line. A lifetime on the line does not pass to the lines below it.

A line that starts with a space takes the owner of the line above it, and another server skips the ;off line. So the line after an ;off line must name its owner, and a line there that starts with a space is refused. Where an $INCLUDE follows the ;off line, the same holds for the first line of the file that it reads. A directive after the mark is refused, and so is an ANAME record, which this build does not turn off. A SOA record after the mark is refused, because a zone holds one SOA. A record turned off follows the rules of its own line: it is inside the zone, and it is written once. One record that is both served and turned off is refused as well. A record with its owner in another case, or with another lifetime, counts as the same record. So does a name inside the data that differs in case alone, where the type folds it.

An update that adds a record turned off changes nothing, and the record stays off. A checkpoint keeps each ;off line where it is. tadoru zone records prints the records of a zone as the server serves them, with each record turned off as its ;off line. tadoru zone list counts them. Troubleshooting has the messages.

A comment that starts with the exact text ;refreshed= gives the record of its line its refresh time. It opts that record in to aging, whoever writes the mark:

nas IN A 192.168.1.10 ;refreshed=2026-10-21T12:00:00Z lease of the NAS

The time is in UTC, in the form YYYY-MM-DDTHH:MM:SSZ, from 1970-01-01T00:00:01Z to 9999-12-31T23:59:59Z. The mark goes first in the comment of the last line of a record, outside parentheses. The rest of the comment follows it after a space. One record holds one mark. The server refuses a mark of another form and a second mark. It also refuses a mark on a line of its own or on a directive. It refuses one on an ;off line, on the SOA or on an ANAME record. Any other comment is a comment, such as ; refreshed= with a space after the ;. The server keeps the text ;refreshed= for this mark, so do not start a note with it. A static stub refuses the mark, because a stub is no primary and none of its records ages: delete the mark. Troubleshooting has the messages.

The server writes the mark too. A checkpoint, which writes the changes of the journal into records.zone, puts the time of each record on its own line. Where the checkpoint keeps the layout, it sets the mark, changes its time in place, or takes it away. It keeps the rest of the line and of the file as it was. Where it cannot keep the layout, it writes the whole zone as an export, which holds every mark and the comment of each record. A record that is turned off loses its mark, because a record turned off has no time. tadoru zone export writes the mark of each record that has a time.

The comment on the line where a record ends is the comment of that record. Where the line has a mark, the comment is the text after the mark:

nas IN A 192.168.1.10 ; the NAS in the hall
www IN A 192.168.1.80 ;refreshed=2026-10-21T12:00:00Z test page
;off old IN A 192.168.1.11 ; before the move

The comments are the NAS in the hall, test page and before the move. The server removes the blanks at both ends, and a comment of blanks alone is no comment. A record turned off takes the comment of its ;off line in the same way. A comment of any length loads. GET /api/zones/{id}/records gives the comment of each record that has one in comment.

Only that one comment belongs to a record. A comment on a line of its own belongs to no record. Neither does a comment inside the parentheses of a record that runs over several lines. For such a record, write the comment after the ):

@ IN SOA ns admin (
2026110601 ; serial, which is no comment of the SOA
3600 600 604800 300
) ; the start of authority

The comment of a directive, such as $TTL, and of an ANAME line belongs to no record either.

A comment is no data of the record. It goes into no answer and no zone transfer, and it moves no serial. The record keeps its comment when a change gives it a new lifetime, turns it off or turns it on. A record that leaves the zone loses its comment, and a record added again later has none. The SOA keeps its comment when the serial moves. A checkpoint writes a new, changed or cleared comment on the line of its record, in place. It keeps the rest of the line and of the file. Where it cannot keep a comment that way, it writes the whole zone as its export, which holds every comment of a record.

tadoru zone export writes the comment of each record at the end of its line: after the mark, or after ; where the line has no mark. After a ;refreshed= mark, a comment with a word that starts with ;refreshed= would read as a second mark. That can happen where you wrote such a comment on a record with no mark and an update then gave the record a time. The export then keeps the comment on the line of the record. It writes each such word with a space after the ;, as ; refreshed=. In a zone with record_expiry, a word that starts with ;expires= gets the same space, as ; expires=. The comment stays the comment of the record. A checkpoint that writes it so logs a warning that names the record and the word: ;refreshed=, ;expires=, or both.

A record can carry an expiry time: the time at which it is to leave the zone. Only a zone whose zone.toml sets record_expiry = true reads it. There, a comment that starts with the exact text ;expires= gives the record of its line its expiry time:

zones/home-arpa/zone.toml
name = "home.arpa"
record_expiry = true
test 60 IN A 192.168.1.90 ;expires=2026-12-01T00:00:00Z the test page
lease 60 IN A 192.168.1.91 ;refreshed=2026-11-01T00:00:00Z ;expires=2026-12-01T00:00:00Z
;off old IN A 192.168.1.11 ;expires=2026-12-01T00:00:00Z before the move

The time has the form and the range of ;refreshed=: UTC, YYYY-MM-DDTHH:MM:SSZ, from 1970-01-01T00:00:01Z to 9999-12-31T23:59:59Z. The mark goes first in the comment of the line where the record ends, or right after a ;refreshed= mark. The rest is the comment of the record. A record turned off keeps its mark. The server refuses a mark of another form, a second mark, and a ;refreshed= word after the mark. It also refuses a mark on a line of its own, inside parentheses, on a directive, on the SOA or on an ANAME record.

In a zone without record_expiry, ;expires= is the text of a comment. A file of a build before the key reads as before, so it never deletes a record by itself.

The key holds these rules:

  • It is a key of a primary whose records are one file. A stub refuses it, and so does a zone that $INCLUDE splits, because the server writes no change into a zone of several files.
  • A change that turns the key on is refused where the zone holds an expiry time at or before the time of the change. The server reads the zone with the changes of its journal. A change through the API stays in the journal until the checkpoint. A rollback to a revision with the key is such a change too. The refusal names the record. Delete the mark, or give it a later time, first. Where the change is taken, a warning names the first five records whose mark is now an expiry time, and how many there are.
  • A change that turns the key on is refused too while the clock of this machine is wrong. The same holds while a time client has not yet set it, as the clock gate says. A clock far behind takes a past time for a time that is to come. Turn the key on once the clock is set.
  • A change that turns the key off is refused while a record of the zone holds an expiry time. The time can be in its files or in its journal. Clear the times first. One hand edit can delete the marks and the key together. So no time waits in a zone without the key, and no old time comes back with the key.
  • A rollback to a revision without the key is taken. It clears every expiry time of the zone, because the zone takes the files of that revision, and they hold no time. A mark that those files hold stays there as the text of a comment. A later change that turns the key on judges it as any turn on does. A past time is refused, and a later one is taken.
  • A start and a restore take the files that they find, and the rules of the key above do not judge them. Every other rule of a zone still does. Files that leave no NS record of the apex without an expiry time stop the start. See No NS record of the apex without an expiry time.

The apex keeps one NS record with no expiry time, so that no expiry time takes the last name server of the zone. Only the NS records that the apex serves count: a record turned off does not. The server refuses a change of the files that marks every NS record of the apex. It refuses a change that turns the key on over such files, and a rollback to them. The refusal has the type /problems/apex-ns-expiry. Give one NS record of the apex no mark, or add one without a mark.

@ IN NS ns1.home.arpa. ;expires=2026-12-01T00:00:00Z the old server
@ IN NS ns2.home.arpa.

Here ns2 is the NS record with no expiry time. A dynamic update (RFC 2136) that deletes ns2 keeps it. The server skips that delete and applies the rest of the update. It answers NOERROR, as it skips a delete of the last NS record of the apex. Today no rule of an update policy covers the NS set of the apex. So an update that names it is refused (REFUSED) before that rule is reached.

A change of records through POST /api/zones/{id}/records that removes or turns off the last such NS record is refused whole: nothing of the request applies. The answer is 422 with the type /problems/apex-ns-expiry and "rule": "apex-ns-expiry", and no list, index, file or setting, because no one line breaks the rule. Add an NS record without a mark in the same request, or remove the mark of another NS record first.

The server keeps each expiry time through the journal and the checkpoint. tadoru zone export writes the mark of each record that has one. A checkpoint sets, moves or clears the mark on the line of its record, in place. An expiry time is no data of the record: it goes into no answer and no zone transfer, and it moves no serial. GET /api/zones/{id} gives record_expiry, so the console knows whether to offer the field. GET /api/zones/{id}/records gives the expiry time of each record that has one in expires_at, in seconds since 1970, only in a zone with record_expiry. The comment and the expiry time come from the files and the journal. So a change of either moves the version of the records and their entity tag.

The server removes each record at its expiry time, served or turned off, through the journal of its zone. So a zone transfer, IXFR and NOTIFY follow the removal. The ledger holds each removal as a command of the origin expiry. The time comes from the zone clock of the server. A step of the wall clock or a restart cannot move that clock (A zone clock that holds).

  • The server looks at a zone within a second of the time of its record. It removes the records of one zone at a time, so where the removal of another zone runs then, it looks once that removal ends. Then the removal waits for the writer: a checkpoint or an update that runs takes it first.
  • While any update waits in the queue of the server, a due zone gives way to the updates for 10 minutes at most. A backlog that takes several removals gives way once, and then drains.
  • The timed records of a delegation leave together, at the latest expiry time among them. These are the NS and DS records of its cut, and the glue below it or that its NS records name. So glue whose time passed waits for the NS record of its cut.
  • One removal takes about 1,000 records or 1 MiB of the journal, and the next removal follows at once. These bounds are soft. The records of a delegation stay one group, so the first group of a removal goes whole even where it alone passes them.
  • No record leaves while the zone clock holds, after a step of the wall clock or a lost aging.clock. None leaves while the clock gate says that the clock is wrong or not yet set. None leaves while the zone is frozen, turned off, stopped, at its files or listed. A record whose time fell while the server was stopped waits for one quiet hour of a set clock after the start. Each of these is looked at again at the next tick of the clock, once a minute, and at the next change of the zone.
  • Where a removal would break a rule of the zone, or a check across the files of the configuration, nothing leaves. The server logs a warning. It tries again after an hour, or at once after a change of the records or of the expiry times of the zone. A change of a comment alone keeps the hour. Change the time or the records that the rule names.
  • Where a write fails, the server logs a warning, and tries again after 1 minute, then 2, 4, 8, 16, 32 and 60 minutes. A warning of a zone and a reason comes once a day at the most. So does the warning of the clock gate or of the zone clock, once for the server. A state of the zone and the wait for the outage give no warning: GET /api/zones/{id} says them.
  • After a suspend of the host, the server looks again within a minute of the resume.
  • A downstream cache keeps a removed record for up to its lifetime, so give a record with an expiry time a short lifetime.

GET /api/zones/{id} of a zone with record_expiry gives expiry, and the list of the zones does not. Read it where a record is past its expiry time and is still in the zone.

"expiry": { "next_at": 1796083200, "blocked": "rule", "retry_at": 1796086800 }
  • next_at is the earliest time at which a group of records of the zone is due, in seconds since 1970. A group is a record alone, due at its expiry time. It is also the timed records of a delegation, due together at the latest of their times. It is null where no record of the zone has an expiry time.
  • blocked says why a group past its time is still in the zone. Where more than one reason holds, it gives the first of this list:
    • gate: the clock gate says that the clock of this machine is wrong or not yet set.
    • clock: the zone clock holds. That happens after a step of the wall clock or at a start, or where the clocks of the host did not read together. It happens also where the zone clock or the task of the removals ended, after a panic or at the stop.
    • outage: the time of the record fell while the server was stopped, and it waits for one quiet hour of a set clock.
    • state: the zone is in a state that the removals pass over, which state names. It is frozen, off, stopped, at-files or listed for a zone that serves its files. It is unsettled for a change of the zone that did not settle. It is received for a zone whose command the writer took and did not yet finish.
    • rule or cross-file: a rule of the zone, or a check across the files of the configuration, refused the last removal.
    • failed: the last removal failed.
  • blocked is absent where no group is past its time. It is absent also where the zone is due and its removal is still to come. The removal waits behind the removal of another zone, the writer, or the updates that wait, as When a record leaves says. It is also absent for a short time after a change of the zone, until the server looks at the zone as it is now. It looks after each change and at least once a minute. So a reason never belongs to the records before the change.
  • retry_at is when the server tries the zone again, with blocked rule, cross-file or failed alone, in seconds since 1970. It is an estimate from the wall clock and the time that the wait had left. So it can move by a few seconds between two reads.

GET /api/health with a credential, and tadoru health, name the zone clock and the clock gate once. They list each zone whose last removal a check refused or that failed. A zone held by a state is not listed there. The zone clock shows where it holds a zone past its time. It shows where it or the task of the removals broke, and where a write of aging.clock failed. An outage shows only where a record waits for it, because each start after a stop opens one.

GET /api/zones/{id}/records gives each record the time that it last changed on this server, as modified_at, in seconds since 1970. The time moves where a record is added, where its lifetime changes, and where it is turned off or on. A change of the data of a record is a removal and an add, so the record with the new data has a new time. A change of the case of a name keeps the time, and so does a refresh of the ;refreshed= mark. The SOA takes a new time at each move of the serial.

A change that the running server makes has the time at which the server made it. Such changes are an update or a change through the API, for example. A hand edit has the time at which the running server took the edit in, which is later than the save of the file. A change of the records with the server stopped leaves the zone with no times in this release.

Where the time is not known, the record has no modified_at at all, never null or 0. That holds for a record from before this release, until it changes. It holds for every record after a restore or a loss of record_times.sqlite. It holds for a zone where the server could not keep a time exact (Change times of records that are not known). The server never shows a guess. Each machine keeps its own times, from the changes that it saw, so two servers can give two times for one record.

The times are outside the version of the records and its ETag. Two reads of one version can give different times. A rollback or a hand edit that brings back the same records brings back the same version. The records that it put back have new times. A failed write of the times, a failure of the server that stops the times, and a restart can take times away. So never keep a time by the version or the ETag: read the page again. A change through the API still takes the ETag as If-Match.

A record that ages has a ;refreshed= mark (The time of a refresh). GET /api/zones/{id}/records gives the time of that mark as refreshed_at, in seconds since 1970. A record that does not age has no refreshed_at at all, never null or 0, and neither has a record that is turned off. A refresh moves refreshed_at and leaves modified_at, because a refresh does not change the record. Unlike modified_at, refreshed_at is part of the files of the zone. So a refresh moves the version of the records and its ETag, and one version gives one refreshed_at. It is on each machine that holds the files of this primary, and a restore gives the times of the restored files. A secondary shows no refreshed_at. The advice to never keep a time by the version or the ETag is for modified_at alone.

A stub zone is a zone on other servers, such as an Active Directory domain. This server knows the names and the addresses of those servers. A static stub has no primaries in zone.toml, and its records.zone holds the NS records of its name and the addresses of its servers:

# zones/corp/records.zone, beside kind = "stub" in zone.toml
$TTL 300
@ IN NS dc1
@ IN NS dc2
@ IN NS ns.elsewhere.example.
dc1 IN A 10.0.0.53
dc1 IN AAAA 2001:db8::53
dc2 IN A 10.0.0.54

The file holds nothing else. It holds no SOA and no other type. It holds no NS record below the name of the zone, and no address of a name that no NS record names. Every record is inside the zone. The file names one to eight servers, with eight addresses at most for each. A server under localhost is refused, because it is this machine. So is an address that this server sends no query to: loopback, an unspecified address, link-local or multicast.

A server inside the zone is reached by its address in the file alone, because its name resolves through the stub itself. A server outside the zone has no address here, because a zone file holds no name outside its zone. One server at least must be reachable: inside the zone with an address, or outside it. An address counts in a family that this server uses: with ipv6 = "disabled", a server with AAAA records alone is no way in. A server outside the zone is reachable where this server can look up its address. For that, it recurses or forwards to an upstream. Where a zone of yours holds the name of the server, that zone must hold an address for it. A stub with no server to ask is refused. Each further server inside the zone without an address gives a warning in the log.

A stub reads no $INCLUDE line and no ;off line. It reads no other *.zone file beside records.zone. The lines and the lifetimes read as in any zone file, and a stub keeps no lifetime.

This build serves a static stub. A client that may recurse and sets RD gets its answer from a walk that starts at the servers in the file. The walk never starts at the root. Every other client gets REFUSED, or the referral of the cut where a zone of yours delegates the name. dnssec and rebind_protection in zone.toml decide whether the answers are validated and whether they may hold a private address. GET /api/zones/{id} of a stub gives both in stub, as the file sets them, and validate and true where it sets none. tadoru config validate zones/corp reports a mistake in records.zone with its line.

A stub and a [[forward]] for one name are refused. So is a stub at the name of a zone of yours, or inside one at a name that is no cut. A stub at a cut of your zone, or below it, is served. A dynamic update that deletes such a cut is refused. A cut that an update added holds a stub as a cut in the file does. tadoru zone list shows a stub with the kind stub, and no serial or count of records. tadoru zone delete deletes a stub as it deletes a zone, and enable and disable turn a stub on and off. records, export, import, change, create, checkpoint, freeze, thaw, journal and witness act on primary zones alone. records, and export with the server running, answer that the id is a stub zone, which holds no records. With the server stopped, export answers that the revision holds no zone of that id. PATCH /api/zones/{id} changes the other settings of a stub. A stub that holds the journal of a primary zone takes no change from a PATCH, a hand edit, a rollback or a restore. It takes only its deletion. Delete it, then make the zone again, roll back or restore. A refusal of create says that the id can name a stub zone. Troubleshooting has the messages.

A stub with primaries in zone.toml, and no records.zone, learns its servers. This server asks the first primary, with recursion off, for the SOA of the zone. Then it asks for the NS set, then for the addresses of each server inside the zone. A question with no reply is asked three times at most. Where a primary fails a step, the next one is asked from the start. A refresh takes one minute at most, and four refreshes run at once at most. The servers go to STATE_ROOT/zones/<zone-id>/stub.zone, with the primaries they came from, and then into service.

A primary can be a loopback address, such as 127.0.0.1:53, where a static stub refuses one in its records.zone. The two rules differ because two different things send the queries. This server reads each primary as it reads the destination of a [[forward]], and the refresh asks it over an exchange of its own. So a primary on the same machine works, as a resolver on the same machine works for a [[forward]]. The walk of the stub asks the servers that the stub learned, never its primaries. That walk sends no query to a loopback, unspecified, link-local or multicast address. This is the same rule as for the servers in the file of a static stub. So a refresh that learns such an address for a server fails, and the stub keeps the servers it had.

The SOA of the primary sets the timers, held between bounds. The refresh is between 5 minutes and one day. The retry is between one minute and one hour. The expire is between the refresh and four weeks. A stub asks again at its refresh, and after a failure at its retry. It keeps the servers it learned while no primary answers.

Past its expire, a stub answers SERVFAIL, with extended error 22, to a question that needs its servers, because they can be gone. An answer already in the cache under the stub still answers until its lifetime ends. A refresh that succeeds brings the stub back.

A start serves the servers in stub.zone at once, so it does not wait for a primary, and a stub past its expire stays expired. Each start also asks the primaries at once. A file that does not read, or that holds the servers of other primaries, is logged with a warning. The warning reads the stub zone did not load its stub.zone, and asks its primaries. The stub asks a primary. A file of other primaries is deleted, and so is the file of a stub that is no longer in the configuration. When a stub leaves the configuration, or its name or its primaries change, its stub.zone is deleted.

A stub with enabled = false keeps its stub.zone and its servers. It is not refreshed, and it answers no name, until it is turned on again. Then it serves those servers at once, and asks its primaries.

POST /api/zones/{id}/refresh asks the primaries of a learned stub now, without waiting for the timers, such as after the servers of the other domain changed. It makes no revision. The body is empty, or {}. An ask starts a refresh at most once a minute. The minute counts from the start of the last try, whatever started it: the timers, a change of the configuration, or an ask. Inside that minute, and while a refresh runs, an ask starts nothing, and the answer gives the time from which an ask can start one. Where four refreshes already run, the ask waits, and the stub starts at the next free place. The answer is 202, with started, running, queued and next_refresh_at. A refresh that runs past its minute answers next_refresh_at as now. So does a refresh that started before a change of the configuration changed the stub, because the stub as it is now has not started yet. Read the zone again for the result.

GET /api/zones/{id} gives the tries of a learned stub that is on in stub: last_try, with when it ended, succeeded or failed, and the words of the server, at most 512 bytes; running; and next_refresh_at. The words name the primary that answered and the servers that it gave, or each primary and why it failed, such as a refusal or a timeout. The server keeps the tries in memory, so after a start they are absent until the first try. Where the wall clock moved back past the start of the last try, next_refresh_at reads the time of the read, while an ask can still meet the minute for up to a minute: the answer of that ask gives the true time, because the server measures the minute on a clock that does not move back. The same route answers on the socket for the server’s own uid and root, and on a TCP door for the role operator or admin. A primary or a static stub has nothing to refresh, and Troubleshooting has the refusals.

POST /api/zones with "kind": "stub" makes a stub zone in one revision. With servers, each a name and its addresses where it is inside the zone, it writes zone.toml and a records.zone of those servers. That makes a static stub. With primaries, it writes zone.toml alone, and the stub learns its servers. A request takes one of the two lists, and not an empty one. It takes no name_server and no addresses, not even an empty list, because they are for a primary. Each name in the request is absolute, so a server dc1 is the name dc1. and not a server inside the zone: write dc1.corp.example. A name is in ASCII, and a label outside ASCII is written as its A-label, which starts with xn--. The route writes each name in its presentation form, in the case of the request. DELETE /api/zones/{id} deletes a stub in one revision: its zone.toml, and its records.zone where it is a static stub. The stub.zone of a learned stub then goes, as it goes when a stub leaves the configuration. Over the socket, the server’s own uid and root make and delete a stub with no account, as they make and delete a primary. On a TCP door, an account with the role operator or admin is needed. tadoru zone create makes primary zones alone. API Reference has the request, and Troubleshooting has its refusals.

POST /api/zones/{id}/convert changes the kind of a zone in one revision, so the apex never stops answering. It turns a primary into a stub and a stub into a primary. It also turns a static stub into a stub that learns its servers, and back. The zone keeps its apex. It also keeps the row of its apex in the serial witness, so a secondary of the apex never sees the serial go back. PATCH /api/zones/{id} does not change kind.

The body names the new kind and its keys, as POST /api/zones takes them, with no name:

{"kind": "stub", "primaries": ["10.0.0.53"]}
{"kind": "stub", "servers": [{"name": "dc1.corp.example", "addresses": ["10.0.0.53"]}]}
{"kind": "primary", "name_server": "ns.home.arpa", "addresses": ["192.168.1.2"], "serial": "date"}

The server writes the new zone.toml from the old one, and nothing of the old file comes from the body. These keys go over:

  • name and enabled, for every change.
  • dnssec and rebind_protection, where a stub changes its source.

Each key that the new kind does not take is dropped. A primary that becomes a stub loses update, default_ttl, ns_ttl, record_expiry, serial, query_from, notify and transfer. A stub that becomes a primary loses primaries, dnssec and rebind_protection. A stub made of a primary takes the defaults of dnssec and rebind_protection, and a PATCH sets them after. Every other line of the file stays as it was, its comments included. The answer names the keys of the old file that went over in carried, and those that were dropped in dropped:

{"revision": 412, "command": "api:9f31c0a7de54b18e2b7ac641", "zone": "corp-example", "carried": ["enabled"], "dropped": ["update", "notify", "transfer"]}

The files follow the new kind. A new primary gets a records.zone from the defaults of [zones], as POST /api/zones writes one. A static stub gets a records.zone of its servers. A stub that learns its servers holds no records.zone. A stub that stops learning its servers loses its stub.zone in the state root. Every other file of the old directory, such as a file of $INCLUDE, is deleted.

A frozen primary takes no convert. Thaw it with tadoru zone thaw <zone-id> first, then convert it. Over the socket, the server’s own uid and root convert a zone with no account. On a TCP door, an account with the role operator or admin is needed.

A new zone at an id takes what a journal left under that id. A primary replays the journal, and a stub takes no change while it is there. So a convert that keeps the id is refused with 422 zone-journal where the id holds such a trace. Each of these is a trace:

  • a journal file
  • a row of the journal in the ledger
  • a statement of a freeze state
  • history of a journal tied to the id

A primary that took updates leaves one. Name a new id in the body:

{"kind": "stub", "primaries": ["10.0.0.53"], "id": "corp-example-2"}

The zone moves to the new id in the same revision, and zone in the answer is the new id. The journal, its rows in the ledger and the statements of its freeze state stay under the old id, as for a deleted zone. A zone made later under the old id meets them. A new id that holds a trace of its own is refused too.

GET /api/zones/{id} says "journal": true where the id holds such a trace, so a client knows before the convert whether to ask for a new id. It also says true in three more cases: the look failed, it did not end within 2 seconds, or it found no free place. So true can mean that the server did not look. The convert always looks again. A primary that is frozen, or whose freeze state is in doubt or not read yet, takes no convert at any id, whatever journal says. History of a journal that no zone is tied to counts under every id, so then every id reads true.

POST /api/zones/{id}/convert/check takes the same body. It judges the convert as the convert itself does, and changes nothing. It answers the refusal that the convert gets. Or it answers the id after the change, with the keys that go over and the keys that are dropped. A key of a convert that landed gets "unchanged": true, with the command of that convert and its lists. This holds also where the convert moved the zone. Troubleshooting says what each refusal means.

  • No secondary zones. kind takes primary or stub. A zone of yours transfers out to a secondary, as Zone transfers says, and no zone transfers in.
  • No changes kept across a restart. After one, an IXFR gets the whole zone once.
  • No NOTIFY is taken in. A NOTIFY that this server gets is answered NOTIMP, since it has no secondary zone. It sends NOTIFY to the secondaries of its own zones, as NOTIFY says.
  • No TSIG. An update is trusted by the address of its sender alone. A rule in [[update.allow]] trusts a network, and does not prove who sent the update. See Updates: [[update.allow]].
  • No aging of records. A record that an update added stays until another update removes it.
  • No command turns a record off or on. Edit the ;off line in the file.
  • No DNSSEC. A zone is not signed, and nothing sets the AD bit.

Read the files of a zone before the server does. The argument is the directory, because no file of a zone means anything alone:

Terminal window
tadoru config validate zones/home-arpa

A zone with only one of zone.toml and records.zone is refused. So is a file under zones/ that is not zone.toml or a *.zone file in a zone directory. What your editor leaves behind is the exception: a name starting with ., or ending with ~ or .tmp, is skipped.

The server checks a revision whole. So one zone that does not read refuses every other change in that revision, and the last good configuration keeps serving. Fix that zone, or move it out of zones/.

tadoru zone export prints a zone as one master file, and tadoru zone import makes a zone from one. Use them to move a zone between this server and another, or to keep a copy of a zone.

Terminal window
tadoru zone export home-arpa > home.arpa.zone
tadoru zone import lab --name lab.home.arpa lab.zone
tadoru zone import home-arpa --replace home.arpa.zone

BIND and Knot read the export. An ANAME line is the exception: this server alone reads it, and the command names such lines on standard error. Each record turned off goes out as its ;off line, after the records of its owner and type. A record with a refresh time ends its line with its ;refreshed= mark, which another server reads as a comment. A CAA record whose tag has a capital letter, such as Issue, goes out in the generic form, \# and the data in hex. That keeps its exact bytes. The text form writes a tag in lower case. A file to import holds all the records of its zone, so an $INCLUDE in it is refused. For a zone from BIND, named-compilezone -o - <zone> <file> writes the zone as one file first. While the server runs, the import goes to it over the socket, and with the server stopped the command writes the revision itself. A zone that takes updates takes no import: freeze it, copy the file to its records.zone in the configuration root, and thaw it. To add the records of a file to a zone without replacing the rest, run tadoru zone import <zone> --merge <file> while the server runs. With --replace-sets, each set that the file names ends as the file states it. The merge goes through the route of Merging a file into a zone.

Terminal window
tadoru zone import home-arpa --merge more.zone
tadoru zone import home-arpa --merge --replace-sets more.zone

tadoru zone has the commands and their options.

A zone this server cannot use is refused whole, and the last good configuration keeps serving. The message names the zone. It names the line as well where the fault is on one line, and the number of any limit the zone passed.

The apex needs a SOA record and an NS record. Two SOA records, or a SOA anywhere but the apex, is refused. A record for a name outside the zone is refused.

A delegation and a DNAME have rules of their own, and each mistake is a refused revision:

  • A record at a delegation other than its NS records, its DS records, and the address of a server that a delegation names.
  • A record below a delegation other than the address of a server that a delegation names.
  • A delegation whose servers all sit below delegations of the zone with no address. No resolver can reach one of them. A delegation that has such a server beside one a resolver can reach is served, and the log names the server without an address.
  • A DS record anywhere but at a delegation, and a DS record whose digest has another length than its digest type makes.
  • An NS record or a DS record at a wildcard name, because a wildcard cannot be a delegation.
  • Two DNAME records at one name, a DNAME beside a CNAME, a DNAME at a delegation, and a DNAME at a wildcard name.
  • A record below the owner of a DNAME, and a zone whose name is below the owner of a DNAME in another zone.
  • DNAME records that map back to a name they already mapped, in one zone or across zones.

A null MX beside another MX at one name is refused, because a null MX says that the name takes no mail. One name is one alias, so two CNAME records at one name are refused. Other data at the owner of a CNAME is refused as well, because a name is an alias or it is data. Records of one name and one type with different lifetimes are refused. They travel in one answer, and one answer carries one lifetime. Two types at one name keep their own lifetimes. One record written twice at one name is refused as well, because a set holds each record once. A name inside the data of MX, NS, CNAME, PTR or SRV that differs in case alone, such as MAIL.home.arpa., counts as the same record.

Two zones cannot have one apex, and that refusal names both directories. One zone under another is allowed. With zones for home.arpa and iot.home.arpa, the longer apex answers every name below it.

The limits:

  • 200 zones;
  • 100,000 records in one zone, and 300,000 names in one zone;
  • 1,000,000 records in all zones together, and 3,000,000 names in all zones together;
  • a chain of 8 aliases.

A master file, such as records.zone, holds 16 MiB at most, and one record’s data holds 65,535 bytes. One zone reads 64 files and 32 MiB of text, each include counted, and includes nest 4 deep. All the files of the configuration together hold 256 MiB, so sixteen master files at their bound fill it. The name limit is the one to know about, because a zone names more than it lists. A record for a.b.c.home.arpa names b.c.home.arpa and c.home.arpa as well.

The server keeps earlier revisions of the configuration for a rollback. A master file that a revision did not change is normally one file on the disk with the revision before it. The file is records.zone or a file it includes. So a change to server.toml does not copy a large zone. A file that carries an access control list, or a directory of the store with a default one, is copied instead.

Troubleshooting has the refusals you meet most, with what to do about them.