Configuration
Every setting lives in a TOML file you can edit, and every change becomes a numbered revision with an audit trail. There are two ways to make a change and they are the same way underneath. You edit a file, and the watcher turns your edit into a revision. Or you call the API, and it writes the file for you.
Most changes take effect with no restart. Seven wait for the next start:
- Moving the metrics endpoint.
- Turning the metrics endpoint off.
- Changing
udp_workersfor an address that is already served. - A longer
clock_grace_minutes. - A new
telemetry_storage. - A new
telemetry_memory_mibwhile the query log runs in memory. - A change of the device of an address that is already served in one of the six DNS listen lists, taking the device off the entry too (A listener on a device).
An address that leaves its list does not wait for a restart. A new address in listen takes the new udp_workers at once. With
udp_workers = 0, a restart starts one worker per core. So once the machine gains or loses cores,
an address already served waits for a restart too.
The server says when a change waits. The answer of a change through the API names each setting
that waits in waits_for_restart. GET /api/info names them for the running revision. The log
gives one warning for each of these changes, with the setting named. The commit that makes the
change gives it, and each later commit gives it again, up to the next start.
A hand edit and an API write can race, and one of the two can be lost. A save that lands between the API reading the file and replacing it overwrites what the API wrote, or the other way round. No rule of the file system can prevent that.
tadoru config edit is the way round it. It edits a copy, and it sends the revision it
started from. A change that arrives while you are typing is refused rather than
replaced. The command line has it, and it works whether or not the server is running.
node.toml: what this machine does
Section titled “node.toml: what this machine does”This file stays on the machine. Nothing in it travels to another server in a cluster, because every setting in it is about this machine’s own network.
| Setting | Default | Range | What it does |
|---|---|---|---|
name |
none | 1 to 63 characters | Shown in the console. Without it, the host name of the machine |
listen |
["127.0.0.1:5300"] |
Addresses | Where to answer DNS, on UDP and TCP for every entry. On Linux an entry can name a device (A listener on a device) |
metrics_listen |
"127.0.0.1:9153" |
One address | Where Prometheus reads, or an empty string for off |
console_listen |
[] |
Addresses | Where to serve the web console and the API, over TLS. Needs a build with the console |
console_http3 |
false |
true, false |
Serve each address of console_listen over HTTP/3 too, on its UDP port |
api_listen |
[] |
Addresses | Where to serve the API alone, over TLS |
api_trust |
[] |
Up to 16 entries | Reverse proxies whose client header the two lists believe |
api_client_header |
"X-Forwarded-For" |
A header name | Where a proxy of api_trust names the client |
udp_workers |
0 |
0 to 256 | UDP workers, each with its own socket. Zero means one per core |
exclude_ports |
[] |
Ports and ranges | Source ports no query goes out from, such as a port a VPN uses |
rate_bypass |
[] |
Up to 64 entries | Clients no rate limit applies to, such as a monitoring box |
ecs_trust |
[] |
Up to 64 entries | Senders whose client subnet option this server honours |
proxy_protocol_from |
[] |
Up to 64 entries | Load balancers that must send a PROXY protocol header, on every DNS listener. A list of every public address is refused (A list of proxies the server will not take) |
outbound_addresses |
[] |
Up to 64 addresses | Addresses of this machine that queries go out from |
outbound_proxy |
"" |
http:// or socks5://, an IP address and a port |
The proxy of the requests of the server for itself. A request through it never falls back to direct (Requests through a proxy) |
outbound_proxy_for |
["blocklists", "acme", "updates"] |
Any of blocklists, acme, updates, forwarders, each once |
Which requests use the proxy |
outbound_proxy_bypass |
[] |
Up to 64 entries | Host suffixes, addresses and subnets that go direct |
outbound_proxy_user |
none | 1 to 255 bytes | The user of the proxy. Its password is the node secret outbound_proxy_password |
update_check |
false |
true, false |
Ask GitHub about once a day for a newer release, and name it in GET /api/info. Never downloads or installs one (The update check) |
update_prereleases |
false |
true, false |
Count a pre-release as a newer release. A server that runs a pre-release counts them anyway |
cache_snapshot_minutes |
15 |
0 to 1440 minutes | How often the cache is written to disk. 0 is off and deletes the file |
clock_grace_names |
["pool.ntp.org.", "ntp.ubuntu.com.", "time.cloudflare.com.", "time.google.com.", "time1.google.com.", "time2.google.com.", "time3.google.com.", "time4.google.com.", "time.apple.com.", "time.windows.com.", "time.nist.gov."] |
Up to 64 names | Names that answer while no time client has set the clock |
clock_grace_minutes |
10 |
0 to 60 minutes | How long after a start the clock counts as unconfirmed |
clock_synchronized_file |
"/run/systemd/timesync/synchronized" |
An absolute path, or empty | The file that says a time client set the clock |
log_level |
"info" |
"error", "warn", "info", "debug", "trace" |
How much the server logs. A new value takes effect at once. TADORU_LOG wins where it is set |
log_format |
"text" |
"text", "json" |
How the server writes a log line. A new value takes effect at once. TADORU_LOG_FORMAT wins where it is set |
log_file_days |
0 |
0 to 365 days | How many days of log files to keep in logs/ of the state root, one file for each day. 0 writes no file. A new value takes effect at once, and a lower one deletes the older files at once. Logs and metrics says what the file holds |
log_file_mib |
256 |
16 to 65536 MiB | The most room that the log files take in all. Past it, the server deletes the oldest file other than that of the day. A new value takes effect at once |
log_local_time |
false |
true, false |
Write the time of each log line in the time zone of the machine, with its offset, such as 2026-11-06T17:02:03.123456+01:00, in place of UTC with a Z. The day of a log file follows the same zone. A new value takes effect at once. A change of the zone of the machine shows after a restart. A machine with no zone gives UTC with a warning. Logs and metrics says more |
log_resolution_errors |
true |
true, false |
Keep the four log lines that report a fault of one resolution: three about an alias chain, and one about a reply that changed the case of the question. false drops them, and the lines about the server itself stay. A new value takes effect at once. TADORU_LOG wins where it is set. Logs and metrics names the lines |
telemetry_storage |
"disk" |
"disk", "memory" |
Where the query log and the statistics live: in the state root, or on a tmpfs at the runtime root that a reboot empties (The query log in memory). A change waits for a restart |
telemetry_memory_mib |
64 |
16 to 4096 MiB | The room that a query log in memory may take on its tmpfs. A change waits for a restart. With "disk" it does nothing |
log_level and log_format follow the rules of Logs and metrics. The file names one
level for every part of the server. The HTTP and QUIC libraries stay at info where the level is louder. A level for each part, such as info,resolver=debug, is a value of
the environment variable TADORU_LOG alone. The first line of a start already follows log_format of this
file. It follows log_level too, where that level is not quieter than the one of the configuration
that ran last. Logs and metrics says why. TADORU_LOG and TADORU_LOG_FORMAT
still win where they are set.
An entry is an IP address. A port follows it, or is left out to default to 5300. Six
kinds of entry are refused, each for its own reason. A name needs the resolver this file
configures. A wildcard address answers from an address the query did not arrive on, and a
client discards that reply. An IPv4 address written as an IPv6 address is refused as well.
::ffff:192.168.1.5 is one. The server opens every IPv6 listener as IPv6 only, so it takes no
IPv4 traffic, and it cannot listen on such an address. Write 192.168.1.5. Port zero gives every worker a different port, and a client
knows none of them. The same address twice can be bound once, and the second failure names the
wrong listener. An empty list is refused too, because a server that listens nowhere answers nobody. Remove the setting to use the default, or name an address.
A listener on a device
Section titled “A listener on a device”On Linux, an entry of listen, tls_listen, https_listen, http_listen, quic_listen or
http3_listen can end with @ and the name of a network device or a VRF:
listen = ["192.168.1.2:53@eth0", "10.8.0.1:53@wg0"]tls_listen = ["10.20.0.1:853@vrf-blue"]The sockets of the entry then take only the queries that arrive on that device. A socket on a VRF
takes the queries of that VRF, and its answers leave by the routing table of the VRF. A listener
with no device takes no query that arrives in a VRF, unless net.ipv4.udp_l3mdev_accept and
net.ipv4.tcp_l3mdev_accept are 1.
- The address must still be an address of this host, and a wildcard address stays refused, with or without a device.
- The kernel looks for the address in the routing table of the device. That is the table of its
VRF where the device is a VRF or a member of one, and the main table elsewhere. The kernel does
not check that the device holds the address. So
192.168.1.2:53@eth1binds where192.168.1.2is oneth0, and it then answers only the queries for that address that arrive oneth1. A link-local or a loopback IPv6 address must be on the device itself. Wherenet.ipv4.ip_nonlocal_bindornet.ipv6.ip_nonlocal_bindis 1, the kernel takes any address. - The name of a device is 1 to 15 bytes. It has no
/, no:, no@, no white space and no control character, and it is not.or... A character whose UTF-8 holds the byte 0xA0, such asà, is refused too, because the kernel reads that byte as a space. An alias such aseth0:1is a label of an address, and not a device. - An IPv6 address with a scope, such as
[fe80::1%2]:53, takes no device, because the scope names a device too. Write one of them.[fe80::1]:53@eth0binds the link-local address ofeth0. The server counts the two forms as two addresses. A move of a served address from one form to the other takes two revisions: one that removes it, then one that adds it. - One address and port is named once in a list, whatever the devices. A TCP list and a UDP list
can share one, as before, such as
tls_listenandquic_listen. - A device needs Linux 5.7 or later (A listener on a device).
console_listen,api_listen,metrics_listenandacme_http_listentake no device. Nor do the queries that this server sends: forwarders and the walk keep the routing of the host. An address of bothhttp_listenandacme_http_listenis one socket, with the device of its entry ofhttp_listen. It keeps that device while it is served, also after it leaveshttp_listen.
A revision checks each device before it is applied. This holds for a new entry with a device, and for a change of the device of an address that is served, its removal too. The server binds a socket of the entry to its device on port 0, and closes it at once. A device that does not exist, or an address that its routing table does not hold, refuses the revision. A dry run checks the same, and it does not test that the port is free. The check holds at that moment: a device that goes away later still stops the next start. A change that waits for a restart is checked once. A later revision that asks for the same device, such as an edit of a zone, is not checked again. So it is not refused while that device is down.
A change of the device of an address that is already served waits for a restart. The listener
keeps its socket and its device. The answer of the change names the list in waits_for_restart,
and the log names each address with the device it keeps. A socket cannot take another device
without CAP_NET_RAW, which the service does not hold. A new socket on the served port would collide with the old one.
name is a label for a person, such as dns1 or dns1.example.net, and not an identity: a rename
changes this setting alone. It takes ASCII letters, digits, -, _ and ., and refuses anything
else. Without it, GET /api/info names the host name of the machine, where the server can read
one: /proc/sys/kernel/hostname on Linux, read once at the start. A host name that breaks the same
rule is left out. A container has a host name that the runtime makes up, such as 3f2a9c1d7b44, so
set name there, or give the container a host name. A new value applies at the next read, with no
restart.
The doors of the API
Section titled “The doors of the API”The management API always answers on its socket in the runtime directory. console_listen and
api_listen add doors on the network, each with TLS. console_listen serves the web console and
the API on one address, and api_listen serves the API alone, for a script on another host. Both
are empty by default, and an empty list binds no port.
An address in api_listen serves the API over TLS 1.3. A caller there gets none of the trust that
the socket gives its owner. So every route that needs an account wants a token or a session.
Console and remote API shows how to turn it on and call it. An address in
console_listen serves the web console and the API, with the same rules. Only a binary built with the console serves
it, and any other build refuses an address there.
An entry of either list follows the rules of listen, but takes no device. A port left out defaults to 5343 for
console_listen and to 8453 for api_listen. A wildcard address is refused too, so you name the
network that reaches the API. An address and port of one list cannot be in the other list, or in
listen, tls_listen, https_listen, http_listen, acme_http_listen or metrics_listen. The
address and port of a door of console_listen is kept over UDP too, for HTTP/3, so quic_listen and
http3_listen cannot take it either. An address with a scope counts as the same address without it,
unless it is link-local. A link-local address without a scope, such as one that names a device,
counts as each scope of that address. An address in either list needs tls_certificate_file and tls_private_key_file, tls_pkcs12_file,
or acme_names.
console_http3 = true serves each address of console_listen over HTTP/3 too. It uses the UDP port of
the same address and port, with the same certificate and the same rules as over TCP. It takes no
0-RTT, so a request is never sent before the handshake proves the client. With console_listen
empty, it binds nothing. api_listen takes no HTTP/3. An answer of the door over TCP names the UDP
door in Alt-Svc. It does so for a client that is not a proxy of api_trust, where no DNS listener holds the
same UDP port. Open the UDP port in the firewall as well as the TCP port.
HTTP/3 gives its limits.
Older releases wrote api_listen as one string. A file with api_listen = "" or one address in
quotes still reads, as an empty list or a list of one.
api_trust names the reverse proxies whose api_client_header the two doors believe. It takes
addresses and subnets, up to 16. A list that holds every public address of a family is refused.
Any machine could then choose the address that its failed logins count under. That is
0.0.0.0/0, or every IPv4 address but 224.0.0.0/3 and the private and special ranges, or all
of 2000::/4, however the entries write it.
An entry that starts with ! is a deny entry, as in Who gets recursion. It
takes one peer or a subnet out of a wider entry, and the entry with the longest prefix that holds
the peer decides:
api_trust = ["192.168.1.0/28", "!192.168.1.6"]Here the doors believe the header of each machine of 192.168.1.0/28 but 192.168.1.6, which
counts as a client itself. The limit of 16 counts deny entries too, and the list meets the refusals
of a recursion list. The refusal of a whole family reads the allow entries alone, with no deny entry
applied. So ["0.0.0.0/0", "!192.168.0.0/16"] is refused: it trusts every machine of the internet
but one range. A list of proxies the server will not take
gives each message.
That refusal reads every public address. The public IPv4 addresses are all of 0.0.0.0/0 but
224.0.0.0/3, 0.0.0.0/8, 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16,
172.16.0.0/12 and 192.168.0.0/16. In IPv6 it is 2000::/4, where the registries allocate. So
["2000::/4"] and ["2000::/3"] are refused too. A list is refused as well where it holds every
public IPv4 address but leaves out a range that is not public. An example is
["1.0.0.0/8", "2.0.0.0/7", "4.0.0.0/6", "8.0.0.0/5", "16.0.0.0/4", "32.0.0.0/3", "64.0.0.0/2", "128.0.0.0/2", "192.0.0.0/3"], which leaves out
0.0.0.0/8. A build before this one took such lists. A deny
entry does not change this refusal. The refusal does not keep a narrower list out:
["0.0.0.0/1"] trusts half of the IPv4 addresses and loads, and so do ["3000::/4"] and the
NAT64 prefix ["64:ff9b::/96"]. Name the reverse proxies alone, by address or by their own
small subnet.
A build older than this one takes no deny entry here, and refuses node.toml at the start. Do not
just delete the deny entries before you install one. The machine that a deny entry left out would
then be a trusted proxy. It could choose the address that its failed logins count under. Write
the same set with allow entries alone instead. The example above becomes:
api_trust = ["192.168.1.0/30", "192.168.1.4/31", "192.168.1.7", "192.168.1.8/29"]Where that takes more than 16 entries, name fewer proxies, or write [] to trust none.
The doors count failed logins per address. Behind a proxy that is not in api_trust, every user
has the address of the proxy. So one stranger behind it can lock out every user. With the proxy in
api_trust, each request counts under the last address of api_client_header, which is the
address that the proxy saw. A proxy in api_trust that sends no such address gets 400. A header
from any other peer changes nothing. A change to either setting counts from the next request.
The waits of a TCP connection
Section titled “The waits of a TCP connection”Three settings say how long a connection over TCP waits for its client. Each applies to plain TCP
on listen, and the read and the write wait to DNS over TLS on tls_listen too.
| Setting | Default | Range | What it does |
|---|---|---|---|
tcp_idle_timeout_seconds |
10 |
1 to 300 s | How long a plain TCP connection can wait for a query |
tcp_read_timeout_seconds |
10 |
1 to 60 s | How long the rest of a message can take, once its length arrived |
tcp_write_timeout_seconds |
10 |
1 to 60 s | How long one answer can take to reach the client |
A connection reads the three once, when it is accepted. So a change applies to each new connection, and a connection that runs keeps the waits it started with. The idle wait counts before the first query too, so a client that connects and sends nothing is closed after it. DNS over TLS keeps its own idle wait of 30 seconds. A phone keeps one connection and asks again a few seconds later. A short wait makes it pay a new handshake each time.
The read wait is what closes a client that sends one octet a second to hold a place. A long value lets one such client hold a place for longer. The write wait closes a client that asks and stops reading: each message of an answer or of a zone transfer must leave within it. It is also the last allowance of a connection that closes. A connection that stops trusting its relay waits for the latest deadline of the queries it admitted, and then one write wait. A connection whose client closed its side waits up to 10 minutes for its answers and its zone transfers, or up to a later deadline of a transfer. Then it waits one write wait. Any other end, such as a read wait that ran out, gives the answers still queued one write wait in all. A zone transfer that ends early waits one write wait for room to send its last message.
These keep waits of their own. The PROXY header of a load balancer and the TLS handshake wait 10 seconds each. DNS over HTTPS keeps its own wait. DNS over QUIC and HTTP/3 keep 10 seconds to read and to write on their streams.
The backlog and the UDP buffers
Section titled “The backlog and the UDP buffers”Three settings set options of the sockets of each DNS listener. A revision applies them to the sockets that serve, with no restart, and an address that a revision adds takes them at its bind.
| Setting | Default | Range | What it does |
|---|---|---|---|
tcp_backlog |
128 |
16 to 4096 | Connections that wait for the accept of each TCP listener of DNS |
udp_receive_buffer_kib |
The kernel default | 64 to 65536 KiB | The receive buffer of each UDP socket of a DNS listener |
udp_send_buffer_kib |
The kernel default | 64 to 65536 KiB | The send buffer of each UDP socket of a DNS listener |
tcp_backlog applies to listen, tls_listen, https_listen, http_listen and
acme_http_listen. Past it, the
kernel drops a new handshake and the client sends it again. quic_backlog stays the backlog of
QUIC. The kernel cuts the backlog at net.core.somaxconn with no word, so the server writes a
warning where the setting is higher.
The buffers apply to each UDP worker of listen, and to the sockets of quic_listen and
http3_listen. A burst of queries larger than the receive buffer is dropped by the kernel, and
dns_udp_kernel_drops_total counts it. The kernel caps each buffer at net.core.rmem_max or
net.core.wmem_max. Where it gives less than the setting, the server writes a warning that names
the sysctl, and the socket keeps the size it got. The buffers of the kernel
says how to raise the caps. dns_udp_socket_buffer_bytes shows the size of each buffer.
Remove a buffer setting to give each socket back the default of the kernel. On Linux the kernel gives an explicit size another way than its default. So where the default is odd, or more than twice the cap of now, the socket gets a size near the default. The server writes a warning with both. A restart gives the default exactly.
DNS over TLS
Section titled “DNS over TLS”Three settings turn on DNS over TLS, which a phone set to use this server as its Private DNS
speaks. All three are empty until you set them. An address in tls_listen starts to answer when
the revision that adds it is applied, and stops when a revision removes it. No restart is needed.
| Setting | Default | Range | What it does |
|---|---|---|---|
tls_listen |
[] |
Addresses | Where to answer DNS over TLS, on TCP for every entry |
tls_certificate_file |
none | An absolute path | The certificate chain as a PEM file, the leaf first |
tls_private_key_file |
none | An absolute path | The private key of that leaf as a PEM file |
tls_pkcs12_file |
none | An absolute path | A PKCS #12 file with the chain and its key, in place of the two files |
tls_self_signed |
false |
true, false |
Make a certificate of the server’s own, in place of the files |
An entry of tls_listen follows the rules of listen, and a port left out defaults to 853.
Port 53 is refused, because it carries plain DNS. An address and port that listen also names is
refused, because one TCP port is plain or encrypted, not both. metrics_listen,
console_listen and api_listen cannot take an address of tls_listen either.
To move an address and port from one of listen, tls_listen, https_listen and http_listen
to another, use two revisions. Remove it from the first list in one revision, and add it to the
second in the next. In one revision, the old listener still holds the port when the new one binds
it. So the revision is refused with cannot listen on ....
An address in tls_listen needs a certificate: both files, or tls_pkcs12_file. A revision that
names one file without the other is refused, and so is one that names an address and no
certificate. A revision that names tls_pkcs12_file beside either PEM file is refused, because one
certificate serves every name. The server reads both files where they
are. It never copies the key, so a backup of the server does not hold it.
The server reads both files whenever node.toml names them, with or without tls_listen, and
refuses the revision if either one is wrong. A revision that the command line applies while the
server is stopped is judged at the next start. The rules are these:
- Root or the account that runs the server owns each file. A symbolic link is followed, and its target is what is judged.
- The key file gives nothing to other users and no write to its group, so
0600and0640pass. A group can read the key, because a certbot setup often grants one. - The certificate file gives write to nobody but its owner, so
0644passes. - The certificate file holds at least one certificate, the leaf first. The key file holds one key, the key of that leaf.
- The key is ECDSA P-256, ECDSA P-384, Ed25519, or RSA of 2048 to 4096 bits.
tls_pkcs12_file names one PKCS #12 file in place of the two files, such as a file that Windows
or a router exports. It takes the rules of the key file, and holds 64 KiB at most. Its password is
the secret tls_pkcs12_password of the node, which PUT /api/node/secrets/tls_pkcs12_password
sets, and which no file of the configuration holds. Where no password is set, the server tries the
empty one. Set the password first, then name the file: a revision whose file the password does not
open is refused. A certificate from a PKCS #12 file shows the
steps, and A PKCS #12 file the server will not take each
refusal. The server reads the file at each revision, at the look every 30 seconds where it changed,
and every hour. A change of the password reads it again at once.
tls_self_signed = true makes the server create a certificate of its own. It is for a node with no
other source, such as one on a private network with no name in public DNS. It cannot go with
either PEM file, tls_pkcs12_file or acme_names: such a revision is refused on
tls_self_signed. The certificate names tls_server_name, localhost, and each address of
tls_listen, https_listen, quic_listen, http3_listen, console_listen and api_listen.
It lasts 397 days, and lives in pki/self-signed/ of the state root. The server makes it again,
with the same key, at three times. The first is 30 days before its end. The second is a revision that changes those names. The third is once the
clock is trusted after a start with no trusted clock: a time client set it, or the grace window of
the clock ended. A browser warns at the first visit and
after each new certificate. A certificate that the server makes
says how to check its fingerprint.
The expiry date is not a rule. A server with an expired certificate serves it, and the client refuses it.
The health report lists the certificate under certificates. Its state is ok, expires_soon
inside 14 days, reload_failed where the last read of the files was refused, or expired. Where
no certificate serves yet, a PKCS #12 file reads waiting_for_files until its first read, or
reload_failed where that read was refused. Three
metrics follow DNS over TLS. The gauge dns_tls_certificate_expiry_seconds is the Unix time at
which the certificate expires. The counter dns_tls_handshake_failures_total counts the
handshakes that did not finish, by reason: timeout, protocol, eof, or no_certificate where no certificate serves yet. The gauge
dns_tcp_connections_open counts the open connections by transport, tcp or tls. After a
revision removes the two files, the expiry gauge keeps its last value until the server restarts.
The health report then lists no certificate.
A revision that changes either file serves the new certificate from the next handshake. The server also looks at both files every 30 seconds, and reads them where one changed. A certificate that certbot renews then serves within about a minute without a revision, if the renewed files pass the rules of the key file and the certificate file. A connection that is open keeps its session. A revision that leaves both files as they are keeps the TLS sessions. So a phone that reconnects resumes its session rather than starting a new one. A session of DNS over TLS or DNS over HTTPS resumes for 12 hours at most (Resumed sessions).
| Setting | Default | Range | What it does |
|---|---|---|---|
encrypted_allow_recursion |
["127.0.0.0/8", "::1", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16", "fe80::/10", "fc00::/7"] |
Up to 64 entries | Which clients this server resolves for over an encrypted transport |
This list replaces allow_recursion for a query that arrives over TLS. It reads the same entries,
deny entries too, and every other rule of Who gets recursion stays. A phone
outside the house arrives from an address that nobody knows in advance, so it needs
["0.0.0.0/0", "::/0"] here.
That value gives any stranger who connects the resolver, the blocking and your local zones. The
rate limits still apply. Nobody can forge a source address through it, because TLS needs the TCP
handshake first. So the same value is much less dangerous here than in allow_recursion, where it
makes an open resolver on UDP.
A certificate from ACME
Section titled “A certificate from ACME”Six settings read a certificate from an ACME authority, such as Let’s Encrypt, in place of the two files above. The certificate serves every encrypted listener.
The server orders the certificate when it applies a revision with names in acme_names, and it
renews the certificate before it expires. Until the first certificate arrives, the encrypted
listeners refuse the handshakes of clients. A restart serves the certificate that the server
already holds, and orders a new one only when that one is due for renewal.
The health report lists the ACME certificate under certificates, with the file
pki/acme/current. Its state is waiting_for_acme before the first certificate, and
renewal_failing after an order that failed, with the problem of the authority in problem. An
ACME certificate reads expires_soon inside a sixth of its lifetime, which is 15 days of 90. Two
metrics follow the orders. The counter dns_acme_orders_total counts the orders that ended, by
result: issued, failed or rate_limited. The gauge dns_acme_next_attempt_seconds is the
Unix time of the next planned order, or of the next question about renewal to the authority. It
reads 0 while the server plans nothing, because the source is files or the clock is not trusted.
| Setting | Default | Range | What it does |
|---|---|---|---|
acme_names |
[] |
Up to 100 host names, or wildcards with dns-01 |
The names on the certificate. Empty turns ACME off |
acme_directory |
"letsencrypt" |
"letsencrypt", "letsencrypt-staging", a URL |
The authority |
acme_terms_agreed |
false |
true, false |
Whether you read the terms of the authority and agree |
acme_contact |
[] |
mailto: addresses |
The addresses of the account at the authority |
acme_challenge |
"http-01" |
"http-01", "tls-alpn-01", "dns-01" |
How the authority checks that the names are yours |
acme_http_listen |
[] |
Addresses | Where to answer the http-01 challenge |
acme_dns01_skip |
[] |
Up to 16 IP addresses | The addresses that the wait of dns-01 does not ask |
The server refuses these values:
- A name that is not a host name, an IP address, or a name written twice. The server compares
names in lower case and without a final dot, so
DNS.Example.net.anddns.example.netare the same name. - A wildcard, such as
*.example.net, unlessacme_challenge = "dns-01". An authority proves a wildcard through DNS-01 alone. A wildcard is one*.label before a host name, sowww.*.example.netand*.netare refused. The wildcard and its base name,example.net, can both be in the list. - With
acme_challenge = "dns-01", a name of more than 237 characters, without the*.of a wildcard. Its record_acme-challenge.and the name is a name as well, and a name holds 253. - With
acme_challenge = "dns-01", a name whose record_acme-challenge.and the name is in no zone of yours. A built-in zone, such ashome.arpawith no zone of yours, does not count. Nor does a zone of yours that a built-in zone answers ahead of, such asarpafor a name underresolver.arpa. - With
acme_challenge = "dns-01", a zone of the record that the authority cannot read. Such a zone is one turned off, or one whosequery_fromdoes not hold every address, which is the default. So is a zone where the owner is at or below a delegation or below a DNAME. A zone that$INCLUDEsplits is refused too, because the server cannot write a record back into it. - With
acme_challenge = "dns-01", an owner that holds a record of another type than TXT, turned off or not, or an ANAME of its own. TXT records at the owner are fine, because the record joins them. A wildcard that answers the owner is fine too, because the record makes the owner a name of its own. - With
acme_challenge = "dns-01", a TXT record at the owner with another lifetime than 60 seconds. A TXT set keeps one lifetime, and the record of the challenge has 60. Give each TXT record there 60 seconds, or point the challenge elsewhere with a CNAME. - With
acme_challenge = "dns-01", a CNAME at_acme-challenge.and the name whose target is in no zone of yours, or is a CNAME as well. The zone of the target holds the record, so the rules above hold for it too. - With
acme_challenge = "dns-01"on a server with no forwarders and no recursion, a zone of the record with a name server whose address the server cannot find. The server asks each name server for the record before it tells the authority. It finds an address as an A or AAAA record in the zone of yours that answers the name. It can also find one through a[[forward]]for the name, where no zone of yours answers it first. Glue below a delegation does not count. - More than 100 names. One certificate holds 100 at most.
- An entry of
acme_dns01_skipthat is not an IP address, or that has a port, or is0.0.0.0or::, or is written twice. More than 16 entries, and a list with anotheracme_challengethan"dns-01". acme_namestogether withtls_certificate_file,tls_private_key_fileortls_pkcs12_file. One certificate serves every name, so it comes from the files or from ACME, not both.acme_nameswithacme_terms_agreed = false. Only you can agree to the terms.acme_nameswith no address intls_listen,https_listen,quic_listen,http3_listen,console_listenorapi_listen. A certificate that nothing serves spends a limit of the authority for nothing.acme_challenge = "http-01"with an emptyacme_http_listen.acme_challenge = "tls-alpn-01"with an emptytls_listenand an emptyhttps_listen. The authority checks over TCP, andquic_listenandhttp3_listenuse UDP.acme_challenge = "tls-alpn-01"with an address ofconsole_listenorapi_listenon port 443. The authority asks on port 443, and a door of the API answers no challenge.- An entry of
acme_http_listenthat breaks a rule oftls_listen, or that another TCP listener,metrics_listen,console_listenorapi_listennames. A port left out defaults to 80. An address ofhttp_listencan be here too (see below). - An
acme_directorythat is not one of the two names and not anhttps://URL, or a URL with a user or a password in it. - An entry of
acme_contactthat is not amailto:address.
The server checks every entry even while acme_names is empty, so a typo shows at once.
DNS over HTTPS
Section titled “DNS over HTTPS”Seven settings set DNS over HTTPS, which browsers and the Apple platforms speak. They ask for a URL rather than a host name. A listener starts when the revision that names it is applied, and stops when a revision removes it. No restart is needed.
| Setting | Default | Range | What it does |
|---|---|---|---|
https_listen |
[] |
Addresses | Where to answer DNS over HTTPS, with the certificate of TLS |
http_listen |
[] |
Addresses | Where to answer plain HTTP from a reverse proxy |
http_socket |
false |
true, false |
Whether to answer plain HTTP from a proxy on doh.sock |
http_path |
"/dns-query" |
A URL path | The path of every HTTP listener |
http_trust |
[] |
Up to 64 entries | The proxies whose client header the server believes |
http_client_header |
"X-Forwarded-For" |
A header name | The header a trusted proxy names the client in |
http_help_page |
true |
true, false |
Whether a browser at http_path gets a page that says how to use it |
An entry of https_listen follows the rules of listen, and a port left out defaults to 443. An
entry of http_listen does too, with 8053. One address and port serves one protocol, so it cannot
be in two of listen, tls_listen, https_listen and http_listen. The same address on another
port can. An address in https_listen needs the two certificate files of DNS over TLS, and the
server serves the same certificate on both.
http_listen and doh.sock are for a reverse proxy that holds the TLS session with the client.
They answer only a proxy in http_trust, or one that can open the socket. Any other peer of an
address of http_listen alone gets 403 the moment it connects, and nothing it sends is read. An
address that acme_http_listen names too reads the request of such a peer, as below. doh.sock is in the runtime directory, beside the socket of the management API. Its file
mode lets the server’s own group connect, so add the proxy’s user to that group.
One address can be in http_listen and in acme_http_listen. An example is port 80 of a host where the
authority of ACME checks and a reverse proxy sends DoH. One socket then serves both:
- A sender in
http_trustis the proxy. It gets DoH as onhttp_listen, over HTTP/1.1 or HTTP/2, and the challenge too. - Any other sender gets the challenge alone: a GET of a token that an order waits on. It speaks HTTP/1.1, one request on a connection, its head in 10 seconds and its body in 10 more, of 1 KiB at most. At most 64 such connections are open on the address at once. Any other path gets 403 once the head is read, and the connection closes.
- The sender is the source that a PROXY header names, where the peer is in
proxy_protocol_from. So a load balancer that is not inhttp_trustmakes nobody behind it a proxy. At most 64 of its connections wait for their header at once, apart from the 64 of the challenge. A connection whose header names a sender outsidehttp_trustthen takes a place of the challenge, or is closed.
An address of acme_http_listen alone serves the challenge to everybody, reads no PROXY header,
and counts no client against the limits of connections. A revision that moves an address between
http_listen, acme_http_listen and both keeps its socket. A connection keeps what it got at its
accept. Each request of a proxy reads the revision that answers it. So a proxy whose address
leaves http_listen gets no answer to its next DoH request.
A proxy names the client in a header, and the server reads the last address of the last
http_client_header field. A proxy appends the address it saw, so the last entry is its own. The
earlier entries came from the client, who can write anything. A query over any of the three
listeners reads encrypted_allow_recursion. The client the proxy names is the client for that
list, for the rate limits, for the client table and for the query log. A proxy in http_trust is
not held to the cap of connections per client, because it carries the connections of many.
A list whose allow entries together hold every public address of a family is refused, such as
["0.0.0.0/0"], ["0.0.0.0/1", "128.0.0.0/1"], ["::/0"] or ["2000::/4"]. Any machine that reaches a DoH
listener could then name a client of your network. It would get past encrypted_allow_recursion,
the client rules, the bypass list of blocking and the limits of each client. A deny entry beside
such a list does not change that. A build before this one took such a list, so a node.toml that
loaded before stops the start after the upgrade.
A list of proxies the server will not take gives the
message. Name the reverse proxies instead, by address or by their own subnet.
That refusal reads every public address. The public IPv4 addresses are all of 0.0.0.0/0 but
224.0.0.0/3, 0.0.0.0/8, 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16,
172.16.0.0/12 and 192.168.0.0/16. In IPv6 it is 2000::/4, where the registries allocate. So
["2000::/4"] and ["2000::/3"] are refused too. A list is refused as well where it holds every
public IPv4 address but leaves out a range that is not public. An example is
["1.0.0.0/8", "2.0.0.0/7", "4.0.0.0/6", "8.0.0.0/5", "16.0.0.0/4", "32.0.0.0/3", "64.0.0.0/2", "128.0.0.0/2", "192.0.0.0/3"], which leaves out
0.0.0.0/8. A build before this one took such lists. A deny
entry does not change this refusal. The refusal does not keep a narrower list out:
["0.0.0.0/1"] trusts half of the IPv4 addresses and loads, and so do ["3000::/4"] and the
NAT64 prefix ["64:ff9b::/96"]. Name the reverse proxies alone, by address or by their own
small subnet.
An entry of http_trust that starts with ! is a deny entry, as in Who gets
recursion. It takes one proxy or a subnet out of a wider entry, and the entry
with the longest prefix that holds the proxy decides:
http_trust = ["10.0.0.0/29", "!10.0.0.5"]Here the server believes the header of each machine of 10.0.0.0/29 but 10.0.0.5. That machine
is a client. http_listen gives it 403. https_listen and http3_listen read no header from
it and count its connections. The limit of 64 counts deny entries too, and the list meets the
refusals of a recursion list.
A build older than this one takes no deny entry here, and refuses node.toml at the start. Do not
just delete the deny entries before you install one. The machine that a deny entry left out would
then be a trusted proxy. It could name any client address, and so get past
encrypted_allow_recursion, the client rules and the limits of each client. Write the same set
with allow entries alone instead. The example above becomes:
http_trust = ["10.0.0.0/30", "10.0.0.4", "10.0.0.6/31"]Where that takes more than 64 entries, name fewer proxies, or write [] to trust none.
http_path starts with / and holds no ?, # or space. It is not under
/.well-known/acme-challenge/, the path of the challenge of ACME. A client asks
https://dns.example.net/dns-query with the default.
The counter dns_https_responses_total counts the responses of the HTTP listeners by status
and by version, which is 1.1, 2 or 3. The answers of the challenge of ACME do not count.
The 403 of a sender outside http_trust on an address of acme_http_listen does count.
A run of 403 or 400 is most often a client or a proxy set up wrong. 403 is a peer outside
http_trust, or one that a deny entry of that list holds, so check the entries that start with
!. 400 is a request the server cannot use, for example a trusted proxy that names no
client, a dns parameter that is not base64url, or a body that breaks off. 408 is a POST whose
body did not arrive in 10 seconds, which a slow or stalled client causes rather than a setting. A
request that is not HTTP at all gets its answer from the HTTP library and is not counted. dns_tcp_connections_open counts their connections under
transport="https".
DNS over QUIC
Section titled “DNS over QUIC”Five settings turn on DNS over QUIC (DoQ) and DNS over HTTPS on HTTP/3 (DoH3). QUIC runs over UDP and carries each query on its own stream. So a lost packet does not hold up every query behind it, as it does on TCP. A listener starts when the revision that names it is applied, and stops when a revision removes it. A connection that is open then gets a close at once. No restart is needed.
| Setting | Default | Range | What it does |
|---|---|---|---|
quic_listen |
[] |
Addresses | Where to answer DoQ, with the certificate of TLS |
http3_listen |
[] |
Addresses | Where to answer DoH3, with the certificate of TLS |
quic_idle_timeout_seconds |
30 |
5 to 300 | How long a quiet QUIC connection stays open |
quic_max_streams |
100 |
1 to 1000 | How many queries one QUIC connection can have open |
quic_backlog |
256 |
16 to 4096 | How many connection attempts can be pending at once |
An entry of quic_listen follows the rules of listen, and a port left out defaults to 853. Port
53 is refused, because it carries plain DNS. An entry of http3_listen follows the same rules,
and a port left out defaults to 443. Both lists use UDP, so neither can hold an address and port
that listen holds, and the two cannot share one. An address and port in tls_listen or
https_listen can also be in a QUIC list, because those use TCP. Port 853 for both DoT and DoQ is
the usual setup. An address in either list needs the two certificate files of DNS over TLS. A
response of https_listen names the http3_listen port on the same IP address in an Alt-Svc
header, such as h3=":443"; ma=86400. So a browser can move to HTTP/3 by itself.
The three numbers apply to every QUIC listener, including the ones that run when a revision
changes them. A connection that is open keeps the numbers it started with. The server announces
quic_idle_timeout_seconds to each client, and the shorter of the two sides applies. If a phone reconnects too often, raise
it. A client past quic_max_streams waits for a query to finish before it sends the next one. A
connection attempt past quic_backlog is dropped with no answer, and the client sends it again a
moment later.
Telling a client about the encrypted listeners
Section titled “Telling a client about the encrypted listeners”A client that asks plain DNS for _dns.resolver.arpa gets the encrypted listeners on the address
it asked, and can move to them. Two settings name what the answer says.
| Setting | Default | Range | What it does |
|---|---|---|---|
tls_server_name |
none | A host name | The host name that a client reaches the encrypted listeners by |
advertise_encrypted |
true |
true or false |
Whether the answer names the encrypted listeners of this node |
tls_server_name is a host name of two labels or more, such as dns.example.net, with no final
dot. An IP address, a wildcard, and resolver.arpa or a name under it are refused. A name here
needs an address in tls_listen, https_listen, quic_listen, http3_listen, console_listen or
api_listen. A revision with a name and none of those is refused. So a node that serves the
console alone can hold a name. Without a name, with advertise_encrypted = false, or
with no address in the first four lists, the answer names no listener. Every client then stays on the transport it chose. Such a node reports no problem of discovery in its health, whatever its name.
Which address a query goes out from
Section titled “Which address a query goes out from”Leave outbound_addresses empty on a machine with one address of each family. Then the operating
system picks the source address of each query by the route to the name server. That choice is
right almost always.
Set it on a machine with several addresses where the choice of the operating system is wrong. An example is a firewall that passes DNS from one address only. Each query then goes out from one address of the list, chosen at random among those of the destination’s family. A random choice makes a forged answer harder to aim, the same as a random source port.
outbound_addresses = ["192.0.2.10", "2001:db8:1234::10"]A family with no entry in the list is left to the operating system. A list of IPv4 addresses alone says nothing about IPv6. Each entry is one address, and a prefix is refused. The unspecified address and an IPv4 address written as an IPv6 one are refused as well.
The server refuses a revision that names an address this machine does not hold, and the message names the address. An address can go away while the server runs, because an interface went down. Then each query goes out from the address the system picks instead. The log then carries one line per query that fell back.
Requests through a proxy
Section titled “Requests through a proxy”Four settings name a proxy for the requests that the server makes for itself, and which requests use it. A request through the proxy never falls back to a direct connection. Where the proxy fails, the request fails, and its words name the proxy. The proxy looks up the name of each request, and this machine looks up nothing for it.
A change of the four settings applies with no restart. It applies at the next request of ACME and of a forwarder, and for the lists at their next download. A pass over the lists looks at the configuration last just before each download. Where a change came in by then, the download does not start. That list is read again after the delay of a retry, about half a minute. A change after that look does not reach a download that started, which keeps the routes it started with.
The walk from the root, the stub zones, NOTIFY, the probes of DNS-01 and the DNS client always go direct.
outbound_proxy = "socks5://127.0.0.1:9050"outbound_proxy_for = ["blocklists", "acme", "updates"]outbound_proxy_bypass = ["lan", "10.0.0.0/8"]outbound_proxy_user = "dns"-
outbound_proxyishttp://orsocks5://, in lower case, then an IP address and its port. An IPv6 address goes in brackets, as inhttp://[2001:db8::1]:3128. The port has no default. A host name is refused, because a lookup on this machine can reach this server, whose forwarders can go through the same proxy. A user part, such asuser:password@, is refused, so a password never sits in the file. A path, a query and a fragment are refused too. A refusal never repeats the value. -
outbound_proxy_fornames the requests that use the proxy:blocklistsfor the downloads of the lists,acmefor the requests of ACME,updatesfor The update check, andforwardersfor the forwarders. Each word goes once, in lower case. An empty list beside a proxy is refused, because the proxy would carry nothing.The forwarders are left out by default. Many HTTP proxies tunnel to port 443 alone. A forwarder of DNS over TLS on port 853, or a plain one on port 53, then fails through them. So does every query with it. Add
forwardersonly where the proxy carries those ports, as a SOCKS5 proxy such as Tor does. Through a proxy, a plain forwarder asks over TCP alone, and a forwarder of QUIC or HTTP/3 is refused, because a proxy carries TCP alone. -
outbound_proxy_bypassnames what goes direct. A host suffix such aslanholdslanand every name under it, by whole labels, sonas.langoes direct andplandoes not. An address or a subnet holds the addresses in it. A name is never looked up to test it against a subnet. Case, a final dot and the IPv6 form of an IPv4 address make no new entry. SoLAN.andlanare one entry, and the second is refused. These are refused: a suffix with a leading dot, such as.lan; a suffix underonion; and a subnet with a bit set past its prefix, such as10.1.2.3/8. -
outbound_proxy_useris the user, where the proxy asks for one. It is 1 to 255 bytes, counted in bytes, not characters. Through an HTTP proxy, it holds no colon and no control character, because Basic authentication cannot carry them. With no proxy, the 1 to 255 bytes alone are checked, so the user can stay while the proxy is off. Its password is the node secretoutbound_proxy_password, which Accounts sets. Both kinds of proxy send the user and the password with no encryption on the network to the proxy.
An encrypted forwarder that names no addresses, such as tls://dns.example, is taken only where
its route is a SOCKS5 proxy with forwarders in outbound_proxy_for. The proxy looks the name up.
A name under onion, such as the hidden resolver of a public resolver, takes that form alone. On any
other route the entry is refused with “names no addresses”. So is a change of node.toml that
takes the SOCKS5 route away from such an entry (A forwarder with no addresses after a change of the proxy).
A change of the route of a forwarder empties the cache of answers. Such a change is another proxy, or a user set or taken away. An answer or a failure that came through one proxy is not one of another. The routes of the lists, of ACME and of the update check leave the cache as it is, and so do a new password and another user.
The update check
Section titled “The update check”With update_check = true, the server asks the list of releases of the project on GitHub, about
once a day. It asks whether a newer release than the one that runs is out. GET /api/info then gives the
field update to every role, which the console can show. The server never downloads or
installs a release: it names one, and you decide. A new value of either setting takes effect at
once, with no restart.
update_check = trueupdate_prereleases = false- The first check comes 1 to 10 minutes after the check turns on, at a random moment. Each next one comes about a day later, at most 25 hours. After a failure, the next try waits 1 hour, then 2, 4, 8, 16 and 24 hours, plus up to a quarter more. Where GitHub names a wait, the check waits for the larger of the two, at most 30 hours.
- A failure keeps what the last good check found, marked
failedwith itsreason. The update check fails gives each reason. - A pre-release counts only with
update_prereleases = true, or where the server runs a pre-release itself, such as a build ofmain,0.1.0-dev.42. - An empty list of releases is a good check that found nothing. Today the check ends with
unavailable: the list of releases of the project is not open to a request with no login yet. - The check reads the 150 newest releases. An older one is not seen.
- Turning the check off stops it at once, and the field goes. A lookup of
api.github.comthat has already started on this machine can still finish then, and nothing reads its answer. The same holds at a stop of the server.
What the request tells others:
- GitHub learns the address of this node, or of its proxy, and the version of the server, in the
User-Agent. Nothing else goes: no name of the node, no setting, no token. - With
updatesinoutbound_proxy_for, as by default, and a proxy set, the check goes through the proxy and never falls back to direct (Requests through a proxy). The one exception isoutbound_proxy_bypass. An entry that holdsapi.github.com, such asgithub.com, sends the check direct. GitHub, the resolver and the network path then learn what the next point says. The proxy learns that this node reachesapi.github.com, and the request to it crosses the network in the clear. - Direct, the resolver of this machine learns the name
api.github.com, and the network path sees the address of GitHub and that name in the TLS handshake. - GitHub limits a client with no login to 60 requests an hour for each address. Many nodes behind
one address can reach it, and then a check fails with
limitand waits.
Who gets recursion
Section titled “Who gets recursion”One setting, in its own table because its default is a list of eight ranges.
| Setting | Default | Range | What it does |
|---|---|---|---|
allow_recursion |
["127.0.0.0/8", "::1", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16", "fe80::/10", "fc00::/7"] |
Up to 64 entries | Which clients this server resolves for |
A query from anywhere else is answered REFUSED, with the recursion available bit clear. The default is loopback and the private ranges, so a box behind a router answers the house and nothing beyond it. A resolver that answers the whole internet is found within hours, and used to send large answers to somebody else’s address.
Two kinds of query need this list and one does not. A name this server holds a zone for is
answered whatever the list says, to a client that query_from of the zone holds. That
answer is data on this machine. Over plain UDP, such an answer to a client outside this list counts
against the rate limits (How much one client can ask). A name it has
to ask an upstream about needs the list. So does a name already in the cache, because a
cached answer is the same work with the cost already paid.
With resolution = "recurse", the list matters more. One question from a client can then
cost up to 64 queries to the name servers on the way down. A forwarded question costs one query
to an upstream, and its retries. The list is read before any of them goes out, so a refused
client costs this server a read of the list and nothing more.
A client on the list that clears the RD bit asks for this server’s own data alone. It gets an answer from a zone or from the cache, and REFUSED for any other name. This server does not forward or walk for it. On a route that does not check signatures, a query that also sets the CD or the DO bit skips the cache. So it gets REFUSED for any name outside a zone.
If your provider gives you IPv6, add your own prefix. A house with a routed prefix has global addresses on the inside, and no default can guess which prefix yours is:
allow_recursion = [ "127.0.0.0/8", "::1", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16", "fe80::/10", "fc00::/7", "2001:db8:1234::/48", # the prefix your provider routes to you]A written list replaces the default rather than adding to it, so keep the ranges you still
want. An entry is an address or a subnet. A subnet whose address holds a bit outside
its own prefix is refused: write 192.168.1.0/24 rather than 192.168.1.42/24. One range
named twice is refused as well. So is an IPv4 entry written as an IPv6 one, such as
::ffff:192.168.1.0/120. A client of it arrives as an IPv4 address, and the entry matches
nothing. ::/96 and each range inside it, such as ::/120, write IPv4 addresses that way too,
and are refused. An entry that holds nothing but :: and ::1, such as ::/127, is read. An
empty list resolves for nobody, which leaves a server that answers its own zones alone.
An entry that starts with ! is a deny entry. It takes an address or a subnet out of a wider
entry. For each client, the entry with the longest prefix that holds the client decides, so the
order of the entries does not count:
allow_recursion = ["10.0.0.0/8", "!10.1.0.0/16", "10.1.2.0/24"]Here every address of 10.0.0.0/8 gets recursion, except those of 10.1.0.0/16. Inside that,
10.1.2.0/24 gets it again. So 10.2.0.1 and 10.1.2.1 are answered, and 10.1.5.1 gets
REFUSED. A client address in the IPv4-mapped form, such as ::ffff:10.1.5.1, which a proxy can
name, is read as 10.1.5.1. So it cannot get past a deny entry that way.
A deny entry meets every rule of an entry above, and the limit of 64 counts both kinds. The server also refuses a list where an entry cannot mean what it says:
- The same range as an allow entry and as a deny entry, such as
"10.1.0.0/16"and"!10.1.0.0/16". Neither can decide. Keep one of the two. - A list of deny entries alone. It allows nobody, which
allow_recursion = []says plainly. - A deny entry that no allow entry holds, such as
"!192.168.0.0/16"beside"10.0.0.0/8"alone. It denies nothing. - A deny entry whose nearest wider entry is another deny entry, which denies it already. A deny
inside an allow that lies inside a deny is read: in
["10.0.0.0/8", "!10.1.0.0/16", "10.1.2.0/24", "!10.1.2.0/25"]the last entry takes10.1.2.0/25back out of10.1.2.0/24. - A deny entry whose whole range longer allow entries give back, such as
"!10.1.0.0/16"with"10.1.0.0/17"and"10.1.128.0/17". Removing it changes nothing.
A wrong range is the usual cause of each of them. A recursion list the server will not take gives each message.
A build older than this one takes no deny entry. It reads !10.1.0.0/16 as text that is not an
address, so it refuses node.toml and does not start. Do not just delete the deny entries before
you install one: the clients that a deny entry left out would then get recursion. Write the same
set with allow entries alone in both lists instead, for example with tadoru config edit. The
example above becomes:
allow_recursion = [ "10.0.0.0/16", "10.1.2.0/24", "10.2.0.0/15", "10.4.0.0/14", "10.8.0.0/13", "10.16.0.0/12", "10.32.0.0/11", "10.64.0.0/10", "10.128.0.0/9",]Where that takes more than 64 entries in either list, use fewer allow entries. Their ranges must all
stay inside the set that the list allowed, so that no client gets recursion it did not have. Or
write [] for that list, which resolves for nobody. This holds for allow_recursion and
encrypted_allow_recursion alike.
An ANAME whose target a [[forward]] or a stub zone answers needs the query_from of its zone
inside this list. That check reads the list with its deny entries applied, so a denied subnet
inside that query_from is a hole, and the ANAME is refused (Local Zones).
Do not write 0.0.0.0/0 or ::/0. Each one opens this server to every client on the
internet, and both together open it to every client of either kind. The server accepts them,
because a list of ranges cannot tell a big network from the whole internet. Nothing else
in this file makes a server easier to abuse.
This list is not a firewall rule. A client that sends its queries somewhere else ignores it, and the answer to that is a rule on the router.
How much one client can ask
Section titled “How much one client can ask”A client on the list can send rate_queries_per_minute queries in a minute, 1000 by default, and
that many times rate_window_minutes in its window. Queries over plain UDP spend the same count,
and follow this bar only where rate_udp_queries_per_minute, below, is not set. The subnet around it can send eight times as
many. rate_prefix sets the lengths of that subnet, IPv4 then IPv6: "24/56" by default, a /24
for IPv4 and a /56 for IPv6. Past either limit, the server drops that client’s queries
until its window ends. Over UDP the client gets no answer at all. Over TCP it gets REFUSED, and the
connection closes.
A question the cache cannot answer costs this server far more than one it can, because it needs a
forward or a walk. So a client can also start only rate_resolutions_per_minute of those in a
minute, 100 by default, times rate_window_minutes in its window. It can have
rate_resolutions_in_flight of them waiting at once, 100 by default. The subnet gets eight times
each. Past either one, the server drops that client’s questions the cache cannot answer, the same
way, and still answers the ones it can. Many clients asking one name at once cost one resolution
between them.
A lookup can also fail because it spent the work this server allows one question, or ran out of time. Such a failure says nothing about the name, so it is not remembered for other clients. The subnet that asked gets SERVFAIL for that same name and type for one second instead, without a new lookup.
A client can also hold rate_connections TCP connections open at once, 20 by default. It can open five
times as many in a minute, times rate_window_minutes in its window. The subnet gets eight times
each. A connection past either is closed before this server reads it. These two count every client,
the ones outside allow_recursion as well, because an open connection costs this server a slot
whatever it asks.
Each client’s window starts at its first query, and lasts rate_window_minutes, one minute by
default. Each limit of a minute holds that many times as much over the window. With 5, a client
can send 5000 queries in its five minutes. It can open 5 × rate_connections × 5 connections,
which is 500 at the default. The whole of a window can come at once. With 60, a client can send
60000 queries in its first minute, and then nothing for an hour. The questions waiting and the
connections open are counts of now, so the window does not change them.
The count survives a change to the configuration. A change of rate_window_minutes applies to every
client at once. A longer window extends the window that runs, with what the client sent in it. A
shorter one ends each window that is already older than it. The table of counts holds up to 65536
clients. Where it has no room for a new one, the server drops the entry of a client that is past its
window, or under half of every limit. That client starts a new window at its next query. The
entry of a client at or over half of a limit is not dropped before its window ends. So with 60 it
can stay for up to an hour from the start of its window. An entry with a question waiting or a
connection open is not dropped while they last.
A client outside allow_recursion is counted on what your zones answer it over plain UDP. The
source of a datagram can be forged, and a zone answer goes to the address that the datagram names.
So without a count your zones send large answers to somebody else for small queries. The count is
of its own, in a second table of the same size. So strangers who fill it never take the counts of
the clients of your network. It uses the same settings: rate_udp_queries_per_minute, or
rate_queries_per_minute where the bar of UDP is 0, rate_window_minutes, rate_prefix and
rate_bypass. Past the bar, such a client gets an empty answer with the TC bit set and the code of
the answer it would have got. So a real client asks again over TCP and gets its answer there. An
answer with no record and no Extended DNS Error in it, such as a bare REFUSED, FORMERR or NOTIMP, is not counted. It is about the size of the query. Where such an answer comes out longer than
the query, it is counted. Over TCP, DoT, DoH, DoQ and DoH over HTTP/3 such a client is not counted
per query. A handshake proves its address, and the caps on connections hold.
This bounds what a forged query can make your server send. It does not remove it. Under the bar, a
zone answer can still be larger than the query. Examples are a long TXT set, a NXDOMAIN with its SOA, or a
delegation with its glue. The zones that this build serves itself answer every client, and they
are counted the same way. Only a client in rate_bypass, and a server with both bars at 0, are not
bounded at all. query_from decides who reads your zones at all.
rate_prefix = "32/128" makes the subnet the address. So two addresses are never counted together,
and the SERVFAIL of one second is for the address that asked. Write "16/48" to count a larger
network as one. A change of rate_prefix applies at once:
- Each subnet starts a new window from the counts of its addresses. The questions waiting and the connections open stay counted.
- The counts that the change carries can still refuse a query for one window. For example, an address sent 1000 queries, and its new subnet keeps them. With a lower limit, that subnet then refuses until its window ends, though the address alone is under its limit again.
- The names held off for one second are let go.
- Where the table of counts is full, a subnet with only the counts of its window can lose its entry and start afresh. Its addresses keep their own limits.
The limits of a zone transfer and the TLS sessions keep a /24 and a /56 whatever rate_prefix
says.
rate_udp_queries_per_minute holds plain UDP to a bar of its own on the same count. A UDP
source can be forged, and the answer to a forged source goes to the victim, so you can hold UDP
lower. A client that proved its address in a TCP or QUIC handshake keeps rate_queries_per_minute.
A query over plain UDP passes while the count of its window is under this bar. A query over TCP, DoT, DoH,
DoQ or DoH over HTTP/3 passes while the same count is under rate_queries_per_minute. So a query
over TCP spends what UDP can send too. With a UDP bar of 1000, a client that sent 900 queries over
TCP has 100 left over UDP. The subnet gets eight times each bar. Without the setting, UDP takes the
value of rate_queries_per_minute, and the count is the one of before. Zero turns a bar off for
its transports:
Bar of rate_queries_per_minute |
Bar of rate_udp_queries_per_minute |
What the server does |
|---|---|---|
| on | on | Counts every query, and holds each transport to its bar |
| on | 0 | Counts every query, and drops none over UDP from a client of allow_recursion. A client outside it is held to the other bar over UDP |
| 0 | on | Counts every query, and refuses none over the other transports |
| 0 | 0, or not set | Counts nothing |
Where the table of counts is full, the entry of a client at or over half of the lower bar that is on
is not dropped before its window ends. This holds whatever transport the new clients use. A refusal under either bar
has limit="queries" in the log line and in dns_rate_limited_total.
rate_bypass in node.toml names the clients no limit applies to, such as a monitoring box
that asks every name every minute. It takes addresses and subnets, up to 64, and refuses what
allow_recursion refuses. Zero in rate_queries_per_minute turns its bar off for everybody. A
query over TCP, DoT, DoH, DoQ or DoH over HTTP/3 is then never refused, and it is still counted
where the bar of UDP is on. Where rate_udp_queries_per_minute is not set, zero turns UDP off too,
and nothing is counted.
Telling a server where a client is
Section titled “Telling a server where a client is”A query can carry part of the client’s address, so a content network answers from a server near that client. This is the EDNS Client Subnet option, and both of its directions are off by default.
ecs_send = "24/56" makes queries this server sends carry the first 24 bits of an IPv4 client’s
address, or the first 56 of an IPv6 one. It costs the client privacy, because every server on
the way to a name learns that part of the address. A house behind one public address gains
nothing from it. Its clients are on private addresses, and no option carries a private address.
The root’s servers, every top-level domain’s, and the common public suffixes such as co.uk
never get the option. A server that answers without one does not get it again for a day. Name a
public suffix this server does not know in ecs_exclude. Only the recursive mode sends the
option. A forwarder does not get it.
ecs_network names the network that queries carry in place of the address of a client that sent
no option. It takes one network of each family at most, such as ["192.0.2.0/24", "2001:db8:5::/48"].
Those two are documentation networks, which the check refuses in a real file, so write your own.
It is for a server whose walk leaves through a network that is not the network of its clients.
Examples are a tunnel, a hosted network, a second line, or a house whose clients are on private
addresses. Every client of that family that sent no option then sends this network, on a private
address or on a public one. Every such client shares one cached answer. A client whose option this server
ignores, and a client that sends a SOURCE of 0, still send nothing. A trusted client that names
its own subnet still sends that subnet. A client of the other family sends as before. The answer to
a client carries no option, because the client sent none.
The setting costs privacy. Each authoritative server that the walk asks, past the root, the
top-level domains, the public suffixes and ecs_exclude, learns the network, for each question of
each client of its family. So can anyone who watches that traffic. Where the walk leaves
through a tunnel, that server learns the network only through the option, so the option tells it
what the tunnel hides. RFC 7871 section 10 tells a resolver behind NAT not to send its external
address, and this setting can send it. That departure is on purpose. Leave the setting empty if
you do not want the servers of each zone to learn where your clients are.
A plain answer does not always come from the declared network. Where the cache has no answer
tailored to that network, a client reads a plain answer that the cache holds. A query with no
option fetched it: a query of an ignored option or a SOURCE of 0, or one to a zone in ecs_exclude.
Such an answer was placed for the address that the walk leaves from, such as the end of a tunnel.
A server never adds an option that nobody asked for (RFC 7871 section 7.2.1). A tailored
answer of the network, once the cache holds one, wins over it.
Each network must route on the internet. The check reads the first address of the network, which
is what the option carries. It refuses each range that the IANA special-purpose address registries
(both as updated on 2025-10-09) mark as not globally reachable, multicast, and fec0::/10:
- IPv4:
0.0.0.0/8,10.0.0.0/8,100.64.0.0/10,127.0.0.0/8,169.254.0.0/16,172.16.0.0/12,192.0.0.0/24but for192.0.0.9and192.0.0.10,192.0.2.0/24,192.88.99.2,192.168.0.0/16,198.18.0.0/15,198.51.100.0/24,203.0.113.0/24,224.0.0.0/4and240.0.0.0/4. - IPv6:
::and::1,64:ff9b:1::/48,100::/64,100:0:0:1::/64,2001::/23,2001:db8::/32,3fff::/20,5f00::/16,fc00::/7,fe80::/10,fec0::/10andff00::/8. Inside2001::/23, these route:2001::/32,2001:1::1to2001:1::3,2001:3::/32,2001:4:112::/48,2001:20::/28and2001:30::/28.
So 172.0.0.0/8 passes, and 172.16.0.0/12 does not. The same check decides whether a client’s
own address, or a subnet that a trusted sender names, goes out at all. A network is
no longer than the bits that ecs_send sends of its family. With "24/56", a /25 is refused and
a /20 goes out as a /20. It needs ecs_send on. To turn ecs_send off, empty ecs_network
first, or in the same change. A change of the network empties the cache of answers, because the
answers it holds were placed for the old one.
An ecs_network the server will not take lists each refusal.
ecs_accept = "trusted" makes this server honour the option from a sender in ecs_trust, such
as a resolver in front of this one. The option then also picks the client in clients.toml, by
the subnet it names. An option from any other sender is read and not used, and the answer says
it covers every client.
The query log in memory
Section titled “The query log in memory”With telemetry_storage = "memory", the query log and the statistics live in
RUNTIME_ROOT/telemetry-<id>/, on a tmpfs, and never in a file on a disk. A reboot empties them.
A stop and a start of the packaged service keep them, because the unit keeps /run/tadoru until a
reboot. The kernel can still write the pages of a tmpfs to a swap device, which the server cannot
stop.
The start checks the runtime root first. It must be a tmpfs with a size, not ramfs, and not the
state root. Its free room, with the store that it holds already, must hold
telemetry_memory_mib. Where a check fails, DNS answers and the query log is off. The health and
the log say why, and nothing is written to the disk in its place. The query log in memory
says how to mount a tmpfs of its own at /run/tadoru, and how to give a container one.
telemetry_memory_mib is the room that the store takes: its file, its write-ahead log, its
shared memory and its free pages. The data that the prune keeps takes three quarters of it, the
smaller of that and retention_mib. The hourly counts of stats_retention_days take a quarter of
the data, at 60 KiB a day: 204 days at 64 MiB, and 571 MiB for the default 1826 days. So a change
of node.toml to memory, or to another room, whose days do not fit is refused. The refusal
names the room that the days need and the days that fit. A change of stats_retention_days in
server.toml is never refused for one node. Where its days outgrow the room of a node that runs in
memory, telemetry on that node turns off at the next pass of the writer, until a restart
(The query log in memory).
Both settings wait for a restart. So the place and the room that run are those of the start, and
waits_for_restart names a change of either. After a change of telemetry_storage, the copy at
the old place stays, and the server reports it until a person deletes it
(The place file of the query log). tadoru backup carries
no query log in memory, and tadoru rewrite refuses it (Backup and restore).
server.toml: how this server resolves
Section titled “server.toml: how this server resolves”This file is shared. In a cluster every node runs the same copy of it, because nothing in it is about one machine.
| Setting | Default | Range | What it does |
|---|---|---|---|
forwarders |
[] |
Up to 8 addresses in all | Where to send a question this server cannot answer |
resolution |
"forward" |
forward or recurse |
Hand a question to forwarders, or walk from the root to the zone that holds it |
root_hints |
The published list | Up to 64 addresses | The addresses the recursive mode asks for the root’s servers |
case_randomization |
true |
On or off | Whether each outgoing query writes its name in a random mixture of case |
dnssec_validation |
true |
On or off | Whether an answer is checked against the DNSSEC signatures of its zone |
dnssec_sha1 |
"insecure" |
insecure or validate |
What a zone signed only with SHA-1 proves. Under insecure it answers without the AD bit, as an unsigned zone does |
aggressive_nsec |
true |
On or off | Whether a checked NSEC or NSEC3 record answers the other names it proves absent, with no query upstream |
lame_interval_minutes |
30 |
30 to 1440 min | How long a name server that answered for a zone it does not hold is left alone |
hedge |
true |
On or off | Whether a slow name server earns a second query to another server of its zone. It acts where the walk asks one server at its first exchange: where recursion_parallel is 1, and for background work, such as a prefetch. Off leaves the groups of recursion_parallel on |
recursion_parallel |
1 |
1 to 3 | How many addresses of the name servers of a zone the walk asks at once at its first exchange with the zone, for a question that a client waits for. The first reply of use wins. With 2 or 3 it asks up to that many: fewer where fewer addresses are known or the walk is short of queries, and one alone on a turn of exploration or where the query carries part of a client’s address. The name servers get up to that many times the queries of a first exchange, and a walk spends its 64 queries sooner. A group counts nothing in dns_hedged_queries_total. Background work, such as a prefetch, walks as with 1: no group, and its hedge where hedge is on. hedge = false leaves the groups on |
rate_queries_per_minute |
1000 |
0 to 1000000 | Queries one client address can send in a minute over every transport but plain UDP, and over UDP too where rate_udp_queries_per_minute is not set. Zero turns this bar off |
rate_udp_queries_per_minute |
The value of rate_queries_per_minute |
0 to 1000000 | A second bar on the same count, for a query over plain UDP. A query over TCP spends what UDP can send too. Zero turns this bar off |
rate_resolutions_per_minute |
100 |
0 to 100000 | Questions the cache cannot answer that one client address can send in a minute |
rate_resolutions_in_flight |
100 |
0 to 1000 | Such questions one client address can have waiting at once |
rate_connections |
20 |
0 to 1000 | TCP and QUIC connections one client address can hold open at once. A closed QUIC connection counts until it is gone, three probe timeouts after its close, longer for a slow client |
rate_window_minutes |
1 |
1 to 60 min | How many minutes one count of a client runs over. Each limit of a minute holds that many times as much, and it can all come at once: with 60, 60000 queries in the first minute and then nothing for an hour |
rate_prefix |
"24/56" |
IPv4 8 to 32, IPv6 32 to 128 | The prefix around a client that is counted beside its address. "32/128" counts each address alone, and a change starts each prefix window again from the counts of its addresses |
edns_answer_payload |
1232 |
512 to 4096 bytes | The largest answer over UDP that this server sends, and the size its answers offer. Above 1232 an answer can be fragmented on the way, and a fragment can be lost or forged |
edns_upstream_payload |
1232 |
512 to 4096 bytes | The size that each query to a forwarder or a server of the walk offers. Above 1232 an answer can be fragmented on the way, and a fragment can be lost or forged |
ecs_send |
"off" |
"off" or two lengths such as "24/56" |
Whether queries this server sends carry part of the client’s address |
ecs_accept |
"off" |
"off" or "trusted" |
Whether a client subnet option from a sender in ecs_trust is honoured |
ecs_exclude |
[] |
Up to 64 names | Zones whose servers never hear part of a client’s address |
ecs_network |
[] |
One network of each family | The networks that queries carry in place of the address of a client that sent no option. Needs ecs_send on |
max_concurrent_resolutions |
256 |
1 to 1024 | Resolutions this server runs at once, across every client. It holds 1024 query sockets, and a resolution holds two at its worst, or three where forwarder_concurrency = 2: two exchanges and a chain question of the reply under its checks. With recursion_parallel = 3, a walk holds three, and a race whose chain question goes to such a walk holds four |
ipv6 |
"enabled" |
enabled, disabled or preferred |
Whether the recursive mode reaches a name server over IPv6 |
qname_minimization |
"relaxed" |
relaxed, strict or off |
How much of a name the recursive mode tells each server on the way down |
delegation_bytes |
8388608 |
524288 or more | How much memory the recursive mode’s store of zone cuts accounts for |
resolution_deadline_ms |
3000 |
100 to 10000 ms | How long one resolution takes at most, across every attempt |
upstream_timeout_ms |
2000 |
100 to 10000 ms | How long to wait for one upstream before trying elsewhere: a name server of the walk, and a forwarder without forwarder_timeout_ms |
max_retries |
2 |
0 to 10 | Attempts after the first failure, for a forwarder without forwarder_retries. Every upstream is tried at least once |
forwarder_timeout_ms |
The value of upstream_timeout_ms |
100 to 10000 ms | How long to wait for one forwarder before the next |
forwarder_retries |
The value of max_retries |
0 to 10 | Attempts after the first failure, for a forwarder. Every forwarder is tried at least once |
forwarder_concurrency |
1 |
1 or 2 | How many forwarders one question asks at once. With 2, a question that a client waits for goes to two forwarders of the list at once, and the first answer that passes the checks goes out. The forwarders get about twice the queries, the two forwarders that lead the order both see most names, and they can tell that the two queries are one question. A [[forward]] races inside its to. Background work, such as a prefetch, asks one at a time |
latency_alpha |
20 |
1 to 100 hundredths | How far one measurement moves an upstream’s average round-trip time |
cache_bytes |
67108864 |
32768 or more | How much memory the cache accounts for. The answers take fifteen sixteenths, divided between their shards. The records that prove a name does not exist take the rest. They take 65536 bytes at the least, so a value below 1 MiB accounts for more than it names. The cache has one shard for each core, rounded up to a power of two, and sets that number when the server starts. A reload keeps the number, so a reload that lowers the value gives each shard a smaller share |
minimum_ttl |
0 |
0 to 86400 s | The shortest time to live an answer is stored with |
maximum_ttl |
86400 |
60 to 604800 s | The longest, so a week-long answer cannot pin a name that changed |
failure_ttl |
60 |
1 to 300 s | How long a resolution failure is remembered (RFC 9520) |
denial_without_soa_ttl |
0 |
0 to 300 s | How long a denial with no SOA record is kept. 0 keeps none. See A denial with no SOA |
stale_ttl |
259200 |
0 to 604800 s | How long past its TTL an answer is kept for an outage. 0 turns it off |
stale_answer_ttl |
30 |
1 to 300 s | The TTL an answer past its own goes out with |
stale_reset_ttl |
30 |
1 to 300 s | After a failed refresh, how long the old answer goes out at once |
stale_max_wait_ms |
1800 |
0 to 1800 ms | How long a query waits for a fresh answer before it gets the old one |
prefetch_trigger_percent |
10 |
0 to 50 | Share of the TTL left where a query refreshes an answer early. 0 is off |
prefetch_minimum_ttl |
10 |
1 to 86400 s | The shortest TTL an answer needs to be refreshed early |
rebind_protection |
true |
On or off | Whether an answer from outside that points at a private address is refused |
rebind_allow |
[] |
Up to 64 names | Names whose private answers you expect, one name per entry |
rebind_inside |
[] |
Up to 16 prefixes | Addresses and prefixes this network calls its own, added to the ranges above |
rebind_nat64 |
[] |
Up to 4 prefixes | The NAT64 prefixes this network reaches IPv4 through |
local_zones |
true |
On or off | Whether this server answers the 97 reverse names of unroutable space |
store_names |
true |
On or off | Whether the query log stores the name that was asked for, the upstream that answered, and the path of the answer |
store_clients |
true |
On or off | Whether it stores who asked: address, client name, relay, group |
retention_days |
30 |
1 to 3650 days | How long a query log row is kept |
retention_mib |
512 |
64 to 65536 MiB | The most room the data of the query log and its statistics take |
stats_retention_days |
1826 |
30 to 3650 days | How long the hourly counts are kept |
keep_one_row_in |
1 |
1 to 1000 | Keep one question in this many as a row, and count the others in the statistics alone (Keeping one row in N) |
To forward, name some upstreams:
forwarders = ["1.1.1.1", "9.9.9.9"]An entry is an address, with a port after it or left to default to 53. A name is refused, because a name needs a resolver to become an address, and this list is what configures that resolver. With more than one upstream the fastest is preferred, and the others keep receiving a small share, so an upstream that recovers is noticed. The list holds 8 addresses at most, counting each address in the parentheses of an encrypted entry. A longer list is refused with the count it holds.
Two more entries are refused. 0.0.0.0 and :: mean every address, and as a destination
they mean this machine, so a query sent there comes back here. A port of zero is nowhere
at all. An entry that is one of this machine’s own listening addresses is refused as the
change is applied. That is the same check a forward’s destination goes through below.
Plain DNS over TCP
Section titled “Plain DNS over TCP”An entry that starts with tcp:// asks its upstream over TCP alone, with no datagram first. It
serves a network that blocks UDP to a forwarder:
forwarders = ["tcp://192.0.2.1", "tcp://[2001:db8::53]:5353"]- The rest of the entry is an IP address, with a port after it or left out to use 53, as in a plain entry. A name is refused.
- The server shows the entry back with its port, as it shows a plain entry:
GET /api/servergivestcp://192.0.2.1back astcp://192.0.2.1:53. - The entry keeps one connection open to its upstream, and several queries wait on it at once, as RFC 7766 asks. The connection closes 30 to 35 seconds after its last query. A connection that breaks with a query on it fails that query. It sends the query once more on a new connection instead, where the old connection had answered a query before that query got in line on it.
- Each change of the configuration opens new connections, and the connections of the old revision close once its last query ends. While both are open, they share the 1024 sockets of the server. So on a server that has used all its sockets, a query can fail until the old connections close.
- A
tcp://entry counts as one address of the 8. The same checks as a plain entry refuse a wildcard, port zero and a listener of this machine. A list can holdtcp://and plain entries together. A list that holdstcp://and an encrypted entry is refused, as a mixed list is. - TCP is not encrypted. The ID, the question and the case of the name of each answer must match its query. But anybody on the path can read the question and write such an answer, as over UDP.
The size of an answer over UDP
Section titled “The size of an answer over UDP”edns_answer_payload is the largest answer over UDP that this server sends to a client, 1232
bytes by default. The OPT record of each answer offers the same size, over every transport, and
never more than the 4096 bytes that the server reads. A client that offers less in its own OPT
record gets that much, and never less than 512. A client with no OPT record gets 512, the size of
RFC 1035 section 4.2.1. An answer that does not fit is cut, with the TC bit set, and the client
asks again over TCP. An answer over TCP, TLS, HTTPS or QUIC is never cut for this size. A change
applies to the next query, with no restart.
1232 is the size that avoids fragmentation on most paths. A larger value, up to 4096, can carry a signed answer over UDP on a network you know, such as a LAN with no tunnel. On a path that fragments, a larger answer can be lost, so the client waits and retries, or a fragment can be forged. A larger value also lets a forged query bring back a larger answer to its victim, so raise it only where the clients are known.
edns_upstream_payload is the size that this server offers in the OPT record of each query that
it sends, 1232 bytes by default. That covers queries to a forwarder, to each server of the walk in
the recursive mode, and to the name servers that the check of a DNS-01 challenge of ACME asks. A server that has
a larger answer cuts it with the TC bit set, and this server asks again over TCP. The networks to
the clients and to the internet differ. So the two sizes are two settings: a LAN can carry 4096
bytes where the path upstream drops fragments. A change applies to the next query, with no
restart.
Above 1232, an answer from upstream can be fragmented on the way, and a fragment can be forged into the answer. On a path that drops fragments, an answer larger than the path carries is lost.
The server falls back to 1232 after a loss:
- A UDP query that offered more than 1232 bytes gets no answer within its timeout. Each later UDP query of the same client question then offers at most 1232 bytes. This holds for that server, for the next one, and for the servers that the check of its DNSSEC chain asks.
- A larger answer then comes back cut, and this server asks again over TCP. So the question costs one timeout, 2 seconds of its 3. It still resolves where the rest of the time holds a query and a TCP exchange.
- Where that query waited its whole timeout, and the deadline of the question did not cut it short, this server also remembers the server it asked for one minute. It keeps the memory by the address and port of that server. Every question in that minute, of every client, offers that server at most 1232 bytes over UDP from its first query. So it does not wait the timeout again.
- The memory ends after its minute, at a change of this setting, and at a restart. A reload of other settings keeps it. A UDP answer from that server that one packet of 1500 bytes cannot carry ends it at once. That is more than 1472 bytes from an IPv4 server, or more than 1452 from an IPv6 one.
- A chance loss costs up to a minute of queries at 1232 to that server. A large answer then needs TCP, and where TCP does not finish inside the deadline, the question fails.
- The memory is about the server, not the path. So a node with several outgoing addresses shares it.
Where a server is down and is the only address of its zone, with the default waits of 2 seconds for one upstream and 3 for a question, this holds. The first question waits at the setting, then asks once more at 1232. The deadline cuts that wait, and the zone is not marked as failing. With a wait for one upstream well under the deadline, the retry runs a whole wait and marks the zone. A second question within the minute asks it at 1232 at once. Where that wait runs its whole timeout, the zone is marked as failing, and later questions to it fail at once for about a minute. A wait that the deadline cuts never marks a zone. At 1232 or less, the zone is marked as failing after one timeout. A path that loses even 1232 bytes gets no answer that way: the server does not try 512.
Queries over TCP and the encrypted transports keep the setting, because a stream is not fragmented. A setting below 1232 stays as it is. The refresh of a stub that learns its servers asks each of its questions up to three times, and a try after a lost one offers 1232. Where validation follows an alias that leaves for another route from a route that forwards, the part on that route offers 1232 too. A chain out of a stub zone or out of a zone of this server starts at the setting on the next route. The check of a DNS-01 challenge, which asks one query at a time, starts at the setting.
Two metrics follow the fallback. dns_upstream_payload_fallbacks_total counts each start of the
fallback, once per question. dns_upstream_payload_marks_total counts each server it remembers, once
each time. Neither says whether a later query was sent or answered. Raise the value only where you
know that the path to the upstream carries it.
A server that does not take EDNS answers FORMERR or NOTIMP with no OPT record. It is asked once more with no OPT record only where the query does not need the record. That means validation off, no DNSSEC OK bit and no client subnet option in the query, and a plain UDP or TCP upstream. Otherwise the refusal fails that attempt. An upstream that does not take EDNS says more.
Encrypted forwarders
Section titled “Encrypted forwarders”An entry can ask its upstream over TLS, HTTPS or QUIC. It starts with a scheme, and then gives the name on the upstream’s certificate and the addresses to connect to:
forwarders = [ "tls://dns.quad9.net (9.9.9.9, 149.112.112.112)", "https://cloudflare-dns.com/dns-query (1.1.1.1, 1.0.0.1)",]tls://is DNS over TLS, on port 853 unless the entry names another.https://is DNS over HTTPS, on port 443, and it needs a path, most often/dns-query.quic://is DNS over QUIC, on port 853 unless the entry names another.h3://is DNS over HTTPS on HTTP/3, on port 443, and it takes a path ashttps://does, as inh3://dns.example.net/dns-query (192.0.2.1). The server asks it over HTTP/3 alone, on UDP, and never falls back to HTTP/2 or to plain DNS.https://asks over HTTP/2 alone, so a resolver that answers both is two entries, and the server measures each.
A port goes after the name, as in tls://dns.example.net:8853 (192.0.2.1). The parentheses hold
one to eight IP addresses, with no port. The server never looks the name up, because at a cold
start the forwarder is the resolver it would ask. It connects to the addresses, and it checks that
the certificate holds the name. The name can be an IP address, as in tls://1.1.1.1 (1.1.1.1).
The certificate must then list that address. Cloudflare, Google and Quad9 publish such
certificates.
Each address is an upstream of its own, so the fastest is preferred, as with plain entries. An encrypted query never goes out in plain text. If every encrypted upstream fails, the query fails.
These entries are refused. The refusal names the entry by its place, such as forwarders[0]. It shows the scheme and the host where the scheme is known:
- A scheme other than
tcp,tls,https,quicorh3.tcp://is plain DNS over TCP, above. - A name with no addresses in parentheses after it.
- An
httpsorh3entry with no path, or atlsorquicentry with one. - An
httpsorh3path with a query in it. A trailing{?dns}, the form operators publish, is dropped rather than refused. - A name that is neither a host name of letters, digits and hyphens nor an IP address. A host
name whose last label is digits alone, such as
resolver.123, is refused too. TLS cannot take it as the name of a certificate. - An address list that is wrong: more than eight addresses, one address twice, or an item that is
not an IP address.
0.0.0.0,::and::ffff:0.0.0.0are refused as well. A port of zero after the name is refused too. - A
tlsorquicentry on port 53, which carries plain DNS. - An entry aimed at this machine: at
listen, or at the listener of its own kind, such astls_listenfor atlsentry andhttp3_listenfor anh3entry. - A name under
onionwith addresses, such astls://resolver.onion (192.0.2.1). A name underonionis reached through Tor alone, and a list of addresses would go past Tor. A server whose running configuration holds one, from an older version, still starts with a warning (A forwarder under onion with addresses).
A list is refused where it mixes plain and encrypted entries. A plain entry answers whenever the encrypted ones fail, so anybody on the path can block port 853 and read every name. Make every entry encrypted, or every entry plain.
The server checks each certificate against the trust store of the machine, which it reads at
start. A revision with an encrypted entry, here or in the to of a [[forward]], is refused where
that store holds no certificate. Encrypted forwarders has the entries of the four large services and the steps for a
private root.
DNSSEC
Section titled “DNSSEC”Every answer is checked against the signatures of its zone, from the root’s keys down. A name whose chain of signatures is broken answers SERVFAIL rather than with data somebody else wrote.
dnssec_validation = falseTurn it off to rule validation out while you look at a name that does not answer. Turn it off as well where an upstream strips the signatures and you cannot replace it. The server then answers what the upstream sends, as a server without validation does.
The server also answers a name from a denial it already checked. A signed zone proves a range
of names absent with one NSEC or NSEC3 record. While that record lives, a name inside the range
gets NXDOMAIN from the cache, and no query goes upstream. A name that the zone just added stays
absent here until the record expires. That is three hours at most, and less where the zone’s SOA
says so. To ask upstream about the names inside a range, set aggressive_nsec to false:
aggressive_nsec = falseIn the recursive mode, a name below a cached NXDOMAIN that carries an SOA gets that NXDOMAIN with the setting on or off. A denial with no SOA answers its own name alone (A denial with no SOA). A flush of one name ends the wait for that name, and the setting stays on. The flush also drops the ranges of the zone that holds the name and of every zone above it.
A change to aggressive_nsec keeps the answer cache. Turning it off drops the ranges the server
holds. With dnssec_validation = false it does nothing, because the server has no checked record
to read.
Two metrics follow the ranges. The counter dns_cache_synthesized_total counts the answers that a
range made, by kind: nxdomain, nodata or wildcard. Such an answer is not a cache hit. The
gauge dns_cache_span_bytes is the memory that the ranges hold.
Three settings in node.toml cover a machine whose clock is not set at a start. A
Raspberry Pi with no clock battery is one. A signature is judged against the clock, and a
clock that reads 1970 can judge nothing. clock_grace_names names the servers a time client
asks for, and those names answer without validation until the clock is set.
clock_grace_minutes is how long that lasts, and clock_synchronized_file is the file
whose presence says a time client set the clock. The time client says which file your
time client writes.
The server keeps the root’s keys current with no setting. About once a day, it asks the root
for its key set. It trusts a new key only after it sees that key for 30 days.
GET /api/health shows the keys under dnssec.anchors.
Two metrics follow the refresh. The counter dns_trust_anchor_refreshes_total counts each
refresh by its outcome. The outcome is validated where a trusted key signed the set, and
unvalidated where none did. It is failed where no set came back, and budget where the set
held more signatures than the server checks. It is skipped where the resolver was too busy to
ask. A skipped refresh sent no query, so the total is not a count of queries to the root.
The gauge dns_trust_anchor_keys counts the root keys by state: pending, valid,
missing, revoked or removed. The server trusts the valid keys and the missing keys.
A missing key is one that the last validated set did not hold.
Answering through an outage
Section titled “Answering through an outage”When every upstream stops answering, the server keeps answering the names it already knows.
Where the route checks signatures, this covers a query with DNSSEC OK or Checking Disabled too. A query with RD clear gets no old
answer, and neither does an answer tailored to one client network. On a route that does not check
signatures, such a query skips the cache, so it gets no old answer. An answer
past its time to live stays in the cache for stale_ttl, three days by default. A query for such
a name waits stale_max_wait_ms for a fresh answer. If none comes, the query gets the
old answer, with a time to live of stale_answer_ttl. Where the wait ran out first, the fresh
attempt goes on behind it, and a success updates the cache.
After an attempt fails, the server does not try that name again for stale_reset_ttl. Queries in
that time get the old answer at once. So an outage costs each client the wait once, not on every
query.
stale_max_wait_ms = 0 sends the old answer at once and asks for a fresh one behind it. A wait
longer than resolution_deadline_ms is the same as that deadline, because the attempt ends there
and the old answer goes out. Set stale_ttl = 0 to turn the feature off. The query log marks each
old answer with the source stale.
A denial with no SOA
Section titled “A denial with no SOA”A denial is an NXDOMAIN, or an answer with no record of the type asked. An upstream normally sends the SOA record of its zone with it, and the SOA says how long the denial holds. Some forwarders and some servers send a denial with no SOA. RFC 2308 section 5 advises against keeping such a denial, because nothing says how long it holds. So by default this server keeps none, and a client that asks again sends the question upstream again.
denial_without_soa_ttl keeps such a denial for that many seconds, 300 at most. These rules apply:
maximum_ttlcaps it, andminimum_ttldoes not raise it.- Where DNSSEC proves the denial, the proof can end it sooner. A denial whose proof fails is a
failure, kept for
failure_ttl. - With
dnssec_validationon, a forwarded denial with no proof sends the server to ask for the SOA of the name, to find its zone. So does one from the servers of a stub zone. Where that answer has no SOA either, the client gets SERVFAIL, as with the setting at 0, and nothing is kept. The walk from the root knows the zone it asked, so it needs no such question, and it keeps a denial of an unsigned zone. - Only a denial with an empty answer section counts. A referral, an answer with no record and an NS set, counts as no denial. An NXDOMAIN with the NS set of the zone above the name counts.
- It is never served stale, and a restart loses it.
- An NXDOMAIN with no SOA answers its own name. The cache does not use it for the names below it.
- Each such denial shows in the cache browser with no SOA.
- A client gets no SOA in the answer, so it reads no time to live of the denial.
A revision that lowers the setting, or sets it to 0, drops each such denial. A resolution that runs across the revision stores nothing past the new value.
The risk: two resolvers that keep such denials and ask each other can pass one back and forth. Each keeps it for the setting at most. But each one gets a fresh copy from the other. So the denial can live with no end among them, and a name that comes into being stays denied. The setting bounds how long this server keeps one copy, not how long the denial lives among resolvers. Set 0 where this server forwards to a resolver that can forward back to it, or where another resolver that keeps such denials forwards to this one. Elsewhere, keep it short, such as 30 to 60 seconds.
Public services you can name
Section titled “Public services you can name”Six are common choices. Each one answers the same question differently, so the table says what is different about it.
| Service | Addresses | What is different about it |
|---|---|---|
| Cloudflare | 1.1.1.1, 1.0.0.1, 2606:4700:4700::1111, 2606:4700:4700::1001 |
Filters nothing. Sends no client subnet, so a content network places you by this machine’s address |
8.8.8.8, 8.8.4.4, 2001:4860:4860::8888, 2001:4860:4860::8844 |
Filters nothing. Sends a client subnet, so a content network places you nearer your own address | |
| Quad9 | 9.9.9.9, 149.112.112.112, 2620:fe::fe, 2620:fe::9 |
Answers NXDOMAIN for names on its malware feeds. A Swiss foundation runs it |
| OpenDNS | 208.67.222.222, 208.67.220.220, 2620:119:35::35, 2620:119:53::53 |
Cisco runs it. Blocks phishing. A free account adds category filters, tied to the address you sign in from |
| AdGuard | 94.140.14.14, 94.140.15.15, 2a10:50c0::ad1:ff, 2a10:50c0::ad2:ff |
Blocks advertising and tracking names, which is what this server’s own lists do |
| DNS4EU | 86.54.11.1, 86.54.11.201, 2a13:1001::86:54:11:1, 2a13:1001::86:54:11:201 |
Blocks malware and phishing. Answers inside the European Union, under European Union law |
Each row names two IPv4 addresses and then two IPv6 addresses. The two are one service
reached two ways, and neither of them is the main one. DNS has no primary resolver and no
secondary. This server asks whichever answers fastest and keeps a small share going to the
rest. So 1.1.1.1 and 1.0.0.1 hold the same data and answer the same way.
Name both anyway. They are separate addresses on separate routes, so a route that breaks
takes one of them rather than the whole service. The second address also gets past equipment
that treats the first as special. Some routers and some firewalls swallow 1.1.1.1, because
an address that short reads as a test value to them.
Name two services rather than one, and a bad day at either is still a working house.
What each one is strongest at, and what that costs you:
| Service | Its strength | What it costs |
|---|---|---|
| Cloudflare | Low latency from most networks, and a privacy promise it publishes | A download or a video can come from a server further away |
| The largest network of the six, so an outage is rare | The client subnet in every query names the network that asked | |
| Quad9 | Security filtering from a non-profit with no advertising business | A name it blocks by mistake answers nothing, and your own log shows no reason |
| OpenDNS | Filters by category, which you choose in a web console | The account follows the address you sign in from, so a new address stops the filters |
| AdGuard | Advertising and tracking blocked before your own lists see the name | Two lists block one name, so a name that goes missing has two places to look |
| DNS4EU | One jurisdiction you can name, for every answer it gives | Its servers sit in the European Union, so a client far from there waits longer |
Cloudflare, Google, Quad9 and AdGuard validate DNSSEC. This server also checks the signatures
of each answer, with dnssec_validation. The upstream must keep the signatures, and
Troubleshooting says what happens where it removes them.
Every address above answers plain DNS on port 53, with no encryption. The service you name reads every question your house asks, and so can anybody on the path to it. Cloudflare, Google, Quad9 and AdGuard also answer over TLS and HTTPS, and AdGuard over QUIC. Encrypted forwarders above says how to write those entries.
A filtering upstream blocks a second time, after this server’s own lists. Then a name that goes missing has two places to look, and one of them is not yours. Quad9, OpenDNS, AdGuard and DNS4EU each filter something by default.
Some of the same services publish more than one pair, so you can choose how much they filter:
| Service and what it blocks | Addresses | What changes |
|---|---|---|
| Cloudflare, malware | 1.1.1.2, 1.0.0.2 |
The names on its malware feeds answer nothing |
| Cloudflare, malware and adult content | 1.1.1.3, 1.0.0.3 |
The same, and adult sites as well |
| Quad9, nothing | 9.9.9.10, 149.112.112.10 |
No malware feeds, and no DNSSEC either |
| Quad9, malware, with a client subnet | 9.9.9.11, 149.112.112.11 |
The filters of 9.9.9.9, and downloads come from nearer |
| OpenDNS, adult content | 208.67.222.123, 208.67.220.123 |
No account to set up |
| AdGuard, nothing | 94.140.14.140, 94.140.14.141 |
No advertising or tracking filters |
| AdGuard, advertising, tracking and adult sites | 94.140.14.15, 94.140.15.16 |
The filters of 94.140.14.14, and adult sites as well |
This server holds its own lists, so an upstream that filters nothing leaves one list in charge of what goes missing. The two rows above that block nothing are the ones to name for that.
Three pairs have to agree. upstream_timeout_ms and forwarder_timeout_ms must not outlive
resolution_deadline_ms, and minimum_ttl must not exceed maximum_ttl. A floor above a
ceiling is two rules that cannot both hold, so the server refuses the pair rather than
choosing one.
forwarder_timeout_ms and forwarder_retries set the wait and the retries of a forwarder apart
from the wait of the walk. A forwarder is an entry of forwarders, or of the to of a
[[forward]], and the two keys apply to both. Without them, a forwarder waits
upstream_timeout_ms and takes max_retries, as before, and a change of those two reaches it. A
[[forward]] takes no key of its own. The walk of the recursive mode always waits
upstream_timeout_ms, and max_retries acts on forwarders alone. So a server whose forwarders
are near by can wait 500 ms for each of them and still give a far name server 2000 ms. For an
encrypted forwarder, the wait also covers setting up a new connection: the TCP connect, and the
TLS or QUIC handshake. So keep it well above the time of a few round trips to that forwarder:
upstream_timeout_ms = 2000forwarder_timeout_ms = 500forwarder_retries = 1rebind_allow takes whole names, and it covers the name the server asked the upstream for.
For an alias that leaves your own zone, that is the target rather than the name your client
typed. The log line for a refusal names it, so copy the name from there. A name under an entry
is not covered by it, and an allowed answer is served without being cached.
Troubleshooting has the refusal and the ranges it covers.
rebind_inside is for the addresses on your network that look global. A provider that
delegates an IPv6 prefix to your house puts your own machines on global addresses. No default
can guess which prefix you got. Write it here, in the form 2001:db8:1234::/56. Then an answer
from the internet carrying one of those addresses is refused the same way a 192.168.1.5 answer
is.
An entry is one address or one prefix, of either family. Three entries are refused. A prefix of
length zero, because it holds every address of its family. An IPv4 range written as an IPv6 one,
because this check reads such an answer as the IPv4 address it is. And the same entry twice. The
two addresses 0.0.0.0 and :: stay served whatever you write, because an upstream that filters
a name answers with one of them.
rebind_nat64 is for a network that reaches IPv4 through a translator. An address inside such a
prefix carries an IPv4 address, at a place the length of the prefix decides. That address is what the
check reads, and it then meets every rule above. So an address the check calls inside is refused and
any other one is served. That is how a client behind a translator still reaches a site with no IPv6
of its own.
Write the prefix here rather than in rebind_inside. The two are separate settings because they are
separate rules. Naming a NAT64 prefix in the list above refuses every IPv4-only site for your
clients. A prefix named here wins over that list, which is what a prefix inside your own delegation
needs.
64:ff9b::/96 is read whether you write it or not. The standard gives that prefix to every
network with a translator. An address inside it carries an IPv4 address, wherever the answer came
from. Write this setting for the prefix your own network uses, which nothing can guess.
An entry is an IPv6 prefix of length 32, 40, 48, 56, 64 or 96, which is where the standard puts the address. Seven entries are refused:
- Any other length.
- The
64:ff9b::/96prefix written at another length. - A prefix outside the space a translator can use, which leaves the well-known one,
64:ff9b:1::/48, and your own global addresses. - A prefix inside
2002::/16(6to4) or2001::/23, which holds Teredo, because their addresses carry an IPv4 address of their own. - A prefix that sets the ninth octet, which the standard keeps clear.
- The same entry twice.
- A prefix that holds one you named in
rebind_inside, because this setting is read first and that entry then does nothing.
The list holds at most 4 entries.
A suffix you send somewhere with [[forward]] is not checked at all.
Sending some names to a resolver you choose says why.
local_zones on is the default, and it stops a query about your own network from reaching the
internet. The server answers 97 reverse names itself, with nothing in them. They cover the addresses
that no name on the internet answers for: the private ranges, the shared address space a carrier
hands out, loopback, link-local, the documentation ranges, and the broadcast address. Turn it off and those queries go to your
forwarders instead. If something upstream holds the real answers, turn it off. A router that knows
the names of your own addresses is the case.
Turning it off sends the reverse names of the shared address space out as well, and no public
resolver holds an answer for those. If your provider gives you an address in 100.64.0.0/10, leave
this on, or the reverse lookups of your own connection leak to the internet.
Seven names are answered here whatever that setting says. localhost and every name under it
answer 127.0.0.1 and ::1. test, invalid, home.arpa, local and onion resolve to nothing.
Every name under resolver.arpa exists and holds no record. The one exception is the question a
client asks about the encrypted endpoints of this server, _dns.resolver.arpa of type SVCB, which
names them where tls_server_name names a host. No server on the internet holds a true answer
for any of the seven, so there is nothing to send such a query out for.
local belongs to the protocol your machines use to find each other on the wire, which this server
does not speak. onion belongs to Tor. A client that uses either one does not ask this server,
so answering here costs nothing and keeps the name off the internet.
home.arpa is the name a home network uses for itself. It is the one of the four you are likely
to hold a zone for, and your zone replaces the empty one. Until you write it, a query for a name
there answers that the name does not exist rather than reaching the root servers.
Your own zone wins wherever the two meet, so a zone of yours for 168.192.in-addr.arpa replaces
the built-in one. localhost is the exception. A zone of yours at localhost, or at any name
under it, is refused, and loopback addresses do not make it allowed. tadoru config validate says
so before you apply anything. Every program on every client takes that name as itself, and it takes
every name under it the same way.
A zone of yours at localhost has the refusal a localhost zone gets.
Walking from the root instead
Section titled “Walking from the root instead”To resolve every name from the root, with no upstream at all:
resolution = "recurse"Remove forwarders, or leave it empty. The server refuses a file that sets recurse and
names forwarders, because the file then says two things.
In this mode the server asks the root’s servers first. Then it asks the servers of each zone, down to the zone that holds the name. No single upstream sees every question your house asks. The server checks the DNSSEC signatures of each answer that it walks to. It passes the signatures on to a client that asks with DO. Nobody compared the checks of this mode with those of another validator yet, so forwarding stays the default. Where the two disagree, a good signed name can fail, or a forged one can pass.
With dnssec_validation = false, the server checks nothing and leaves the AD bit clear. It still
asks for the signatures where a client asks with DO, and passes them on. So a machine on your
network that validates DNSSEC itself does its own checks.
The server learns the root’s servers from a list of addresses built into it, which is the list
the root’s operator publishes. Set root_hints only for a root of your own. delegation_bytes
bounds what the server remembers about which servers hold which zone. That memory is kept
across a reload, and a change of its size starts it empty.
The walk tells each server only as much of the name as it needs. The root’s servers hear com
rather than mail.example.com, and only the servers of example.com hear the whole name.
qname_minimization picks how strictly:
relaxed, the default, shortens the name. Some servers deny a name in the middle of a chain, such asb.example.comfor a question abouta.b.example.com. Then this mode asks that zone the whole name once, and the name resolves. The counterdns_minimisation_fallbacks_totalcounts those, and the debug log names the zone.strictnever falls back. A zone whose servers deny such a name stops resolving through this server, while other resolvers still reach it. If you prefer losing a name to telling a server more of it, choose this mode.offsends the whole name to every server.
A zone has several servers, and the server asks the one that answered fastest most of the time.
A server that answered for a zone as though it did not hold it is called lame. The server then
leaves it alone for that zone for lame_interval_minutes, and asks the others. Where every
server of a zone is lame, the server asks them anyway. The counter dns_lame_answers_total
counts lame answers, and dns_all_lame_total counts the times a zone was asked anyway. A
server that stays silent three times in a row is left alone for a minute and then asked once.
The counter dns_throttled_addresses_total counts those rests.
Where the chosen server takes three times its own average to reply, the server also asks the next
one. The first reply of use wins. The counter dns_hedged_queries_total counts those second
queries, and hedge = false turns them off.
With recursion_parallel at 2 or 3, the first exchange with a zone asks up to that many addresses
of its servers at once instead. This holds for a question that a client waits for. That exchange
sends no hedge. Three addresses of one name server can be the three. A query that carries part of a
client’s address goes alone. So with ecs_send on, the setting acts on the queries to the root,
the top-level domains, the public suffixes and the zones of ecs_exclude. With ecs_network, a
client of that family that sends no option of its own carries the network too, also from a private
address. So its queries go alone to a zone that hears the option, as those of a client on a public
address do. The walk of a stub zone takes the setting too, in both modes. So does the lookup of the
address of a name server inside a walk. hedge = false leaves these groups on.
Background work walks as with 1. It has no group, and its hedge applies where hedge is on. Such work includes a prefetch, the fetch of the root keys and the probe of a negative trust anchor. The chain
questions of its checks walk the same way. The probe still asks each server of the zone of its
name.
ipv6 decides the family the walk reaches a name server over. enabled asks a new server over
both families at once and then uses the faster. disabled never uses IPv6. Use it while a network
has an IPv6 route and no IPv6 connection, where every IPv6 address costs a timeout. preferred
tries IPv6 first for a server the walk has not measured yet.
failure_ttl and resolution_deadline_ms apply in this mode as well. A zone whose servers all
stay silent is remembered for failure_ttl. The server then asks nobody about a name in it, not
even the zone above it. Each time the zone fails again, it is remembered twice as long, up to
five minutes. upstream_timeout_ms
is how long the server waits for one name server before it asks the next. A [[forward]]
still sends its suffix where it says, in either mode, and waits forwarder_timeout_ms for each
forwarder where that is set.
Sending some names to a resolver you choose
Section titled “Sending some names to a resolver you choose”Your router knows the names it handed out and this server does not. A [[forward]] sends those names to the router, so the house gets names for its
machines instead of addresses.
[[forward]]suffix = "home.lan"to = ["192.168.1.1"]rebind_protection = false
[[forward]]suffix = "1.168.192.in-addr.arpa"to = ["192.168.1.1"]rebind_protection = falseThe first sends every name under home.lan to the router. The second sends the reverse
names of 192.168.1.0/24 there, so a lookup of 192.168.1.42 answers with the name the
router gave it. Without the second one, that lookup answers with nothing, because
local_zones holds the reverse names of your private ranges.
Both examples carry rebind_protection = false. The paragraph below the table
says what it does.
| Setting | Default | Range | What it does |
|---|---|---|---|
forward |
[] |
Up to 32 entries | One [[forward]] per suffix, longest matching suffix first |
suffix |
A name | The name this entry is about, and every name under it | |
to |
1 to 8 addresses in all | Where to send a query for a name inside the suffix | |
dnssec |
"validate" |
validate or insecure |
Whether the names in the suffix are validated |
note |
255 bytes | Why the suffix is insecure, in your own words |
|
rebind_protection |
true |
On or off | Whether a private answer from this destination is refused |
A query whose name is inside a suffix goes to those addresses and nowhere else. The longest
matching suffix wins, so an entry for 1.168.192.in-addr.arpa and one for in-addr.arpa
can both exist, and the specific one decides. An address takes a port after it, or leaves
one out to default to 53, the same as forwarders.
A destination in to takes every form of forwarders. So a suffix can go to a resolver over DNS
over TLS, HTTPS or QUIC. The certificate check and the refusals are the same:
[[forward]]suffix = "corp.example"to = ["tls://dns.corp.example (10.0.0.53, 10.0.1.53)"]One forward holds plain destinations or encrypted ones, not both. The reason is that of a
forwarders list: a plain one answers whenever the encrypted ones fail. A forward holds 8
addresses in all, and each address in the parentheses of an encrypted destination counts. An
encrypted destination needs the trust store, as an encrypted forwarders entry does.
The DS question for the suffix itself does not go to the forward. DS is data of the parent zone, so
it goes to the route of the name above the suffix, as a query for that name would. That is most
often the ordinary route: forwarders, or recursion. Recursion and a plain forwarders list send
the name of the suffix in plain text. For a private suffix with no chain of trust, write
dnssec = "insecure", which turns validation off for it. Where the server forwards, an encrypted
forwarders list keeps that question encrypted too. Where a zone of yours holds the name above, the
server asks nobody. The names of the suffix then answer without the AD bit, because your zone is not
signed. Where a stub or another [[forward]] covers it, that route gets the question.
For a forward that validates, a change of that route empties the cache, because the answers of the
forward rest on what it proved. So does a refresh that gives other servers to a stub above the
forward. A forward with dnssec = "insecure" proves nothing, so a change above it keeps the
cache.
A forward beats a reverse name this server answers itself, which is the point of it. A zone of your own beats a forward. A zone holds every name below its own name. So a forward for a zone of yours, or for a name inside one, is refused. A delegation in the zone is the exception, because it hands the names at and below it to another server. A forward at or below a delegation is allowed, and it answers the clients that ask with recursion. A delegation that a dynamic update added counts too, where the journal of the zone replays. A zone stopped for its journal counts by its name alone, so a forward inside it is allowed. A zone stopped earlier whose journal now replays counts with its updates, as any other. A delegation to a server inside your network needs one, because the forwarders cannot see that server. Local Zones has the delegation.
rebind_protection on a forward is the setting of that name, for one suffix. Your router
answers private addresses for the names it handed out. That setting refuses exactly those, so
a forward to a router needs it off. Without that line every name under the suffix
answers SERVFAIL, and Troubleshooting has the refusal.
Off covers the names of that suffix and no others. A name outside the suffix, in the same answer from the same destination, is still refused. So a destination cannot answer one query with a private address for a name you never forwarded.
An alias from a name outside the suffix into it is refused as well, and dnssec = "validate" on the
forward does not change that. A signature proves who wrote the alias, not that it is safe to follow.
rebind_allow names each question that may follow such an alias, and
Troubleshooting has the refusal.
A public resolver cannot see the names behind your forward. So it can answer such an alias with
nothing at its target, or say that the target does not exist. Where the server validates, it then
asks the forward for the target itself,
and the answer holds both. It carries the AD bit only where the alias and the target are both
signed and proven. With dnssec_validation = false, and for an alias that a forward with
dnssec = "insecure" gives, the answer is the alias alone. The client asks for the target.
Leave it on for a forward to a resolver you do not control. The names below a public suffix are records somebody else publishes, which is the case the check is for.
A destination that is one of this machine’s own listening addresses is refused, address and port
together. A query for that suffix comes back to this server and waits for itself. The check runs as
the change is applied, rather than as the file is read. listen belongs to one machine, and this file
is shared with every node in a cluster.
Three names are refused as a suffix. The root, because forwarders is the list for every
name. localhost and invalid, because this server has to answer those two itself. test
is allowed.
dnssec = "insecure" turns validation off for the suffix. Use it for a local zone, which
has no chain to the root. A resolver that validates reads unsigned data from such a zone as
bogus. It then answers SERVFAIL for every name in the suffix. Leave it at validate for a
suffix that a public signed zone holds, or the guarantee goes away with no sign of it.
note says why the suffix is insecure. It shows in this file, in the API and in the log
line of a load, and no client receives it. It goes only on a forward that says insecure,
because that is what it explains. For anything else you want to write down, use a # comment.
insecure is for a suffix that you forward to a resolver of your own. A public name whose
signatures are broken goes in a [[negative_trust_anchor]] instead, which the next section
describes. That entry ends by itself, and a forward does not.
Change the forwards by editing the file, or over the API. A PATCH of server.toml takes the
whole list as forward, a list of objects, and replaces every [[forward]] block.
Changing a file over the API says what that does to your comments.
The arrays of tables of blocking.toml and clients.toml go in the whole file for now.
store_names, store_clients, retention_days, retention_mib, stats_retention_days and
keep_one_row_in are about the query log. The query log says what they do to the rows you already have.
retention_mib counts the data of the log, its pages in use, which is what the prune measures.
For a log on the disk, the write-ahead log beside the file does not count. A reader can hold it,
and no delete makes a held log smaller (The query log says more). For a log in
memory, the write-ahead log counts too, because it takes the room of the mount. Free pages that SQLite reuses do not count, so the file on disk can be larger than the
setting. When the file is mostly free space, the prune gives the space back, about 100 ms at a
time between batches of rows, until no page is free. A log that an older
build made without incremental vacuum is rewritten whole with VACUUM instead. That needs room
for a second copy of the file while it runs, and it is not bounded the way a prune pass is. A
give-back that fails leaves the file as it was, and the next prune tries again.
Lowering the setting deletes the oldest rows within a minute. The rows do not come back when you raise it. A prune that is running when you change it ends with the old values, and the next one uses the new ones.
The hourly counts, at about 60 KiB a day, must fit a quarter of retention_mib, so the counts
never push the rows out. At the default 512 MiB that is 2184 days at most. A file that asks for
more is refused, with the two numbers that fix it. The lists of the hours, the busiest names and
clients and the most blocked names, take another quarter at most. The rows keep the rest.
Before you go back to a build without these two settings, remove both from server.toml, because
the older build refuses a key it does not know. It then prunes to its own fixed limits, 512 MiB
and 400 days of counts, at its first prune. If you want to keep more than that, back up
telemetry.sqlite first, with tadoru backup --include-telemetry (Backup and restore), or
accept the prune.
Taking a broken name out of validation
Section titled “Taking a broken name out of validation”A public name whose signatures are broken answers SERVFAIL for every name under it. A
[[negative_trust_anchor]] takes that name out of validation until a time you give. Its names
then answer again, without the AD bit, because nothing proved them.
[[negative_trust_anchor]]suffix = "broken.example"until = 2026-10-01T18:00:00Znote = "their key rollover failed, and they expect a fix today"An entry starts to act a moment after the revision that holds it starts to run, and it stops at
its until. At both moments the server removes the cached answers at and under the suffix. A
failure cached at a name outside the suffix, whose alias leads into it, stays for its own
failure_ttl. Each answer under an entry carries Extended DNS Error 33. Its text names the suffix,
the until in UTC and the note, such as
broken.example. until 2026-10-01T18:00:00Z: DS at the parent matches no key.
No entry acts while the server does not trust its clock. A board with no clock battery starts in
1970, and then every until is in the future. A broken name then fails as it does with no entry.
The server trusts the clock once a time client sets it. It also trusts a clock later than its own
build once clock_grace_minutes ends. tadoru health shows the state of the clock.
| Setting | Default | Range | What it does |
|---|---|---|---|
negative_trust_anchor |
[] |
Up to 32 entries | One [[negative_trust_anchor]] per suffix |
suffix |
A name, not the root | The name this entry is about, and every name under it | |
until |
A date, a time, an offset | When the entry stops acting | |
note |
255 bytes | Why the name is out of validation, in your own words | |
probe |
true |
On or off | Whether the entry ends early once the name validates |
until is a TOML date and time with an offset, such as Z for UTC or +02:00. Without an
offset, the time names a different moment in every time zone. Each node of a cluster then ends
the entry at a different time, so an until with no offset is refused. A date with no time of
day is refused too. The server keeps the moment and not the offset. So the API and tadoru config show server.negative_trust_anchor give it back in UTC, as a quoted string. The file reads
that form as well.
After its until, an entry does nothing, and you delete it. The file read does not refuse an
until in the past. So a server does not refuse to start because an entry ended yesterday.
A change you apply holds each new or changed entry to a week. Its until must be in the future,
and at most 7 days after the change. A longer entry hides a broken name for longer than the fix
takes. When the week ends, you write the entry again. A new note makes a changed entry.
An entry that the running file already holds is not checked again. So an entry that ended does not block an edit of another setting. If the server does not trust the clock of its machine, it refuses each new or changed entry. Such a clock cannot say where the week ends. The command line refuses only a clock that reads earlier than the release. A rollback is not checked. A start and a restore take the files as they are, and a log line warns of an entry that runs past a week.
The root is refused as a suffix, because dnssec_validation = false is the switch for every
name. Two entries for one suffix are refused, because one entry gives one end time.
A suffix whose answers are never validated is refused as well, because the entry never acts. A
suffix at or inside a zone of your own is one. A suffix that goes to a [[forward]] with
dnssec = "insecure" is another. A suffix under a name that this server answers itself, such as
home.arpa, is the third. A [[forward]] comes first, so a suffix under home.arpa is accepted
where a forward that validates takes that name.
note has the rules of a forward’s note: 255 bytes at most, and no control character. Unlike
the note of a forward, it goes to clients. Every answer under the suffix carries it in the text of
Extended DNS Error 33, so do not write anything private in it.
With probe on, the server asks for the SOA record of the suffix every 5 minutes. The check of
the answer ignores every entry. When every answer validates, the entry ends before its until,
and tadoru health --json calls it lifted. A server that does not answer is left out of the
check. The entry stays in the file, and a new
until makes it act again. A new note alone does not. A restart forgets that an entry ended
early. So the entry acts again until the first check, which runs at the start. Turn probe off to
keep the entry until its until in any case. For example, turn it off where the SOA record
validates and www does not. Turn it off also for a suffix below the apex of its zone. There the
check reads a proof that no SOA record exists, and that proof does not test the other records.
Change the [[negative_trust_anchor]] entries the same way as the [[forward]] entries: edit the
file, or send the whole list as negative_trust_anchor in a PATCH.
GET /api/health lists each entry under dnssec.negative_trust_anchors, with its state. An entry
is active, lifted where the check ended it early, or expired past its until. An entry that
is not lifted or expired is waiting while the server does not trust its clock, because no entry
acts then. The dnssec
object is absent where no route validates, and the list goes with it.
Three metrics follow the entries. dns_nta_active is the count of entries that act now. The
counter dns_nta_probes_total counts each check by its outcome. The outcome is fixed where
every reply was signed and valid or proved unsigned, and broken where one reply failed
validation. It is failed where no reply came or the server left a reply undecided, and skipped
where the server asked nothing. A check is failed too where what it rests on changed while it ran.
For example, a learned stub got other servers, or the trust anchors changed. A change of the zones
that moves a route of the suffix, or of a name above it, does the same. The next check, 5 minutes
later, decides. A check whose reply holds an alias, such as a CNAME at the suffix, is failed, and
the entry stays active after it. A later check whose reply holds no alias and validates can still
end it early. The counter dns_nta_answers_total counts the answers that carry
code 33, one per answer. It also counts an answer to a query with no EDNS, which gets no code.
Defaults of a zone
Section titled “Defaults of a zone”The [zones] table holds the values that a zone of yours gets where nobody wrote one. It is a
table, so write it below every setting of the file: a setting written after [zones] belongs to
the table.
Every value of the table acts, with no restart:
serialmoves the serial of a zone on each change that the server makes.query_fromdecides who gets answers from your zones.transferdecides who can transfer them.notifynames the secondaries that hear of each change.default_ttlandns_ttlgive the lifetime of a record thatPOST /api/zones/{id}/recordsadds without one.min_refresh,max_refresh,min_retryandmax_retrybound the timers of a secondary zone. This build reads a secondary zone and does not serve one yet.
The API uses the rest when it creates a primary zone (POST /api/zones). default_ttl, name_server,
responsible, soa_ttl, refresh, retry, expire and minimum give the SOA record and the NS
record of the new zone, and ns_ttl gives the lifetime of that NS record. serial gives its first serial too, unless the request names a scheme of
its own, as The serial says. A value out of its range is refused.
[zones]default_ttl = 3600serial = "increment"name_server = "ns1.example.net"responsible = "hostmaster"query_from = ["192.168.1.0/24", "fd00::/8"]| Setting | Default | Range | What it does |
|---|---|---|---|
zones |
A table | The values a zone gets where nobody wrote one | |
default_ttl |
3600 |
0 to 2147483647 seconds | The lifetime of a record that the API adds without one |
ns_ttl |
The value of default_ttl |
0 to 2147483647 seconds | The lifetime of an NS set that the server writes |
serial |
"increment" |
increment, unixtime or date |
How the server moves the serial on each change it makes |
name_server |
A host name, not an IP | The primary name server of a zone that the API creates | |
responsible |
"hostmaster" |
A local part, or an address | The mailbox of the person responsible for a created zone |
soa_ttl |
3600 |
0 to 2147483647 seconds | The lifetime of the SOA record of a created zone |
refresh |
3600 |
60 to 2147483647 seconds | How often a secondary checks the serial |
retry |
900 |
0 to 2147483647 seconds | How long a secondary waits after a failed check |
expire |
1209600 |
refresh + retry to 2147483647 seconds |
How long a secondary serves the zone without a check |
minimum |
300 |
0 to 2147483647 seconds | The lifetime of a negative answer (RFC 2308) |
query_from |
["127.0.0.0/8", "::1", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16", "fe80::/10", "fc00::/7"] |
Up to 64 entries | The networks whose clients get answers from a zone |
notify |
[] |
Up to 16 addresses | The secondaries that a zone notifies of a change |
min_refresh |
300 |
60 to 2147483647 seconds | The least time between two checks of a secondary |
max_refresh |
86400 |
min_refresh to 2147483647 seconds |
The most time between two checks of a secondary |
min_retry |
60 |
10 to 2147483647 seconds | The least wait of a secondary after a failed check |
max_retry |
3600 |
min_retry to 2147483647 seconds |
The most wait of a secondary after a failed check |
transfer |
A table that holds allow |
Who can transfer a zone. Without a rule, nobody | |
transfer.allow |
Up to 16 rules | The rules, one [[zones.transfer.allow]] each |
Each time is a number of seconds, and at most 2147483647, the largest lifetime a record can carry
(RFC 2181). The timers of a SOA are 32-bit numbers, and this table holds them to the same bound by
choice. So one rule covers every time in it. refresh is at least a minute. expire is at least refresh plus retry, because a
secondary that stops serving the zone before its next check never gets to check it.
min_refresh, max_refresh, min_retry and max_retry are the bounds of the timers of each
secondary zone of this server whose zone.toml names none of them. They are the bounds of a stub
that learns its servers by default, so the two kinds that copy from a primary keep the same pace.
max_refresh is at least min_refresh, and max_retry at least min_retry.
A secondary zone says what they hold.
ns_ttl is the lifetime of an NS set that the server writes. That is the NS set of a primary or of a
static stub that POST /api/zones makes, and a new NS set that POST /api/zones/{id}/records adds
with no lifetime. The addresses of the name server keep default_ttl. An NS set that the zone
serves keeps its lifetime, and a dynamic update states its own. A stub serves no lifetime of its
own, so for a stub ns_ttl sets only the text of its records.zone. Without ns_ttl, an NS set
takes default_ttl, as before the key. So a server that upgrades writes the same zones. A change
counts from the next request, with no restart.
serial names how the server moves the serial of a zone on each change it makes. increment adds
one. unixtime writes the current time. date writes today as YYYYMMDD00. Each does so where that is
ahead of the old serial, and adds one where it is not. A serial that is ahead of the time or the
date, such as one written by hand, moves by one per change until the clock passes it. A zone with
more than a hundred changes a day keeps increment, because date then runs ahead of the calendar.
In this release, two changes move a serial:
- A dynamic update that changes the zone and does not set a serial of its own.
tadoru zone thaw --serial-bumpon an edit whose serial is not ahead of the freeze.
A change of serial counts from the next update or thaw, with no restart. The
serials that the journal holds stay as they are, and a hand edit keeps the serial that you write.
responsible is a local part, which the name of each zone completes, or a whole address. The SOA
writes it as its RNAME, a name whose first label is the local part with each dot in it escaped:
hostmaster on example.com is hostmaster.example.com., and first.last@example.com is
first\.last.example.com.. A local part is letters, digits, dots and the signs of a plain mailbox,
63 bytes at most, with no dot at an end and no two dots together. A quoted local part, a space and a
mailbox outside ASCII are refused, because a domain name has no plain form for them.
name_server has no default: no name is right for every network, and a wrong NS set breaks a
public zone. query_from takes addresses and subnets, as allow_recursion does, but no deny entry:
an entry that starts with ! is refused here. An entry named twice is refused.
query_from holds the default ranges of allow_recursion by default, not the list you wrote
there: 127.0.0.0/8, ::1, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16,
fe80::/10 and fc00::/7. So a zone answers the machine and the private networks of the house, and
nothing beyond them, until you widen the list. Write into query_from each network that you added
to allow_recursion or encrypted_allow_recursion and that may ask your zones. Examples are the IPv6 prefix of
your provider, a VPN range, and the addresses of phones that roam over TLS. A zone that the internet
asks needs query_from = ["0.0.0.0/0", "::/0"]. Such a zone is a public zone, a zone that a secondary outside
those ranges copies, or the zone that holds the record of a dns-01 check. While a zone of yours
takes the default, the start says so in one line of the log. It also warns for each network of the
two recursion lists that the default leaves out. A build before this one let every address ask, so
Upgrade can narrow a zone that answered the internet.
query_from here is the fallback. It covers every zone of yours under zones/ whose zone.toml
names no query_from of its own. A zone that names one follows its own list
(zones/<zone-id>/zone.toml: a name this server holds records
for). The list
covers every answer of the zone: data, a name with nothing of the type, a name that does not exist,
and a referral below a cut. A client outside the
list gets REFUSED for all of them, with no records, also where it is on allow_recursion. Over TCP,
TLS, HTTPS and QUIC, a query with an OPT record also gets Extended DNS Error 18 (Prohibited). Over
UDP the refusal carries no code, so it 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 the
names stay inside your network. query_from = [] refuses everybody.
Two answers are not refusals, and both are the answers that the server gives where you wrote no zone:
- A name that a
[[forward]]covers goes to that forward, for a client onallow_recursion. A client outsideallow_recursiongets REFUSED there, as for any forwarded name. - A name that a zone of the server’s own covers gets the answer of that zone, unless a
[[forward]]covers it. That is a zone of yours underhome.arpa,testor a private reverse range. The zones that the server answers itself, such aslocalhost, answer everybody.
An update from a sender outside the list gets REFUSED with no code, as a sender that no rule names does. A change counts from the next query, with no restart. Local Zones says what the list does not hide.
notify names the secondaries that a zone notifies when its serial changes. A secondary that gets
a NOTIFY asks for the SOA record of the zone, and transfers the zone where the serial is new. A
NOTIFY goes to each entry at a change of the serial and at each start, over UDP, as
NOTIFY says. The list covers every zone of yours
whose zone.toml names no list of its own. Nobody is notified by default.
[zones]notify = ["192.0.2.53", "[2001:db8::53]:5300"]- Each entry is an IP address, with a port after it or left out for 53:
192.0.2.53,192.0.2.53:5300,2001:db8::53or[2001:db8::53]:5300. A name is refused, so no record of a zone can choose where this server sends a NOTIFY. - A list holds 16 entries at most.
notify = []notifies nobody. - An IPv4 address written in its mapped IPv6 form, such as
::ffff:192.0.2.53, reads as the IPv4 address. The old compatible form, such as::192.0.2.53, is refused, and the refusal names the IPv4 address to write. - A loopback address is a target, for a secondary on the same machine.
- A link-local address names its link with the number after a
%:fe80::53%2or[fe80::53%2]:5300. One address on two links is two entries. A link-local address with no link is refused. - The check refuses an entry that names no secondary:
0.0.0.0and::, a multicast address,255.255.255.255, port zero, a scheme such astls://, and an entry that the list already names. A refusal names the entry by its place, counted from 0, such aszones.notify[1]. GET /api/serveranswers each entry with its port, such as192.0.2.53:53. APATCHof a list that reads as the one in the file, such as that answer sent back, changes nothing.- Write
notifyabove the first[[zones.transfer.allow]]block, as every other key of[zones]. - A zone whose
zone.tomlnamesnotifytakes that list in place of this one (NOTIFY:notify).
The server warns of three cases as a revision starts to run, and refuses nothing. A secondary can
transfer from another address than the one it listens on, and a machine can gain an address later.
Each warning is one line at the level warn, with path set to the file to change, and the
warnings of transfers below share their bound of 64 lines.
| What it means | Warning |
|---|---|
No transfer rule of the zone allows a target, or its query_from leaves it out |
zone home notifies 192.0.2.53:53, and its transfer rules or its query_from refuse it |
| The zone holds an ANAME, so no transfer carries it, and it sends no NOTIFY | zone home holds an ANAME, which no transfer carries, so it sends no NOTIFY |
The outbound_addresses of node.toml names addresses, none of the family of a target |
zone home notifies 192.0.2.53:53, and outbound_addresses names no IPv4 address, so no NOTIFY goes there |
A warning names 8 targets and counts the rest. The first warning names the file of the list,
server.toml or zones/<zone-id>/zone.toml. The second names zones/<zone-id>/records.zone, and
the third node.toml, which each machine keeps for itself, so two machines can warn apart. An
empty outbound_addresses gives no warning, because the system then picks the source address.
[[zones.transfer.allow]] names who can transfer a zone. A zone transfer copies a whole zone to
another server, a secondary, over plain TCP. Zone transfers says what a
transfer sends, and how to test one with dig.
No address can transfer a zone until a rule names it, loopback included. A rule is one block. A
client that one rule allows can transfer the zone. Inside one rule, every condition must match.
from is the one condition of this release. Write the blocks after every other key of [zones].
In TOML, a key written below a [[zones.transfer.allow]] block belongs to that rule, and the server
refuses the file:
[zones]query_from = ["0.0.0.0/0", "::/0"]
[[zones.transfer.allow]]from = ["192.0.2.53", "2001:db8::53"]
[[zones.transfer.allow]]from = ["198.51.100.0/28"]| Key | Default | Range | What it does |
|---|---|---|---|
from |
1 to 64 addresses or ranges | The networks a client comes from |
fromtakes the forms ofquery_from: an address, or a range such as198.51.100.0/28. An entry named twice is refused, and so is an IPv4 address or range written in IPv6 form. Unlike[[update.allow]], a rule takes0.0.0.0/0and::/0, so a zone can be open to every address.- A key that a rule does not take is refused, such as
key, which a later release adds. - These rules cover every zone whose
zone.tomlnames no rules of its own (Transfers:[[transfer.allow]]).
A client needs more than a rule. It must also be inside the query_from of the zone, and inside
the query_from of each zone of yours below it, 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 zone that holds an ANAME is never transferred: no transfer carries an
ANAME.
The server warns of each of these as a revision starts to run, and refuses nothing. Each warning is
one line at the level warn, with path set to the file to change, from the config root:
server.toml or zones/<zone-id>/zone.toml for the rules, and zones/<zone-id>/records.zone for
a record, also where a file that it includes holds the record.
| What it means | Warning |
|---|---|
| The rules together hold the whole family | zone home can be transferred by every address of IPv4 |
One network holds more than a /8 of IPv4, or a /16 of IPv6 |
zone home can be transferred by 10.0.0.0/7, a network wider than a /8 of IPv4 |
A client there is refused, because query_from leaves it out |
zone home transfers to 10.0.0.0/8, and query_from refuses part of it |
| A zone below names the clients it refuses, and the ranges for each | zone home transfers to ranges that zones below it refuse in part, so the transfer ... |
| The zone is refused to every client | zone home holds an ANAME, and no transfer carries it |
| No message holds the record, so a transfer ends with SERVFAIL there | zone home holds a TXT record at big.home.arpa. too large for a transfer |
A list names 8 ranges and counts the rest, and the warning of the zones below names 8 zones with 4
ranges each. A revision logs 64 such warnings at most, together with those of notify, and then one
line that counts the rest. An update of a zone logs none again. The next revision logs what it
still finds.
PATCH /api/server changes the rules as one list, such as
{"zones.transfer.allow": [{"from": ["192.0.2.53"]}]}. The list replaces every block: each rule
becomes one [[zones.transfer.allow]] block after every other key of [zones], and the comment
lines above each block stay by place. [] and null both take every block out, and leave the same
text, because no rule is the default here. A list that checks to the rules of the file changes
nothing. zones.transfer, the table by its own name, is refused with 400: send the list.
GET /api/server answers the rules as zones.transfer.allow, and null for zones.transfer
where there is none.
PATCH /api/server changes one key of the table by its dotted name, such as
{"zones.default_ttl": 600}. The table sent whole as an object is refused. In the file as it
ships, the first key of the table brings the commented # [zones] to life where it stands. A key
that the file documents in prose alone, such as ns_ttl and name_server, goes under its
paragraph. That holds too where the file has [[zones.transfer.allow]] blocks and no [zones]
header yet.
Where the file documents no # [zones], the header and the key go right above the first block.
{"zones.default_ttl": null} takes the key out of the table, and the header [zones] stays.
blocking.toml: the lists this server blocks from
Section titled “blocking.toml: the lists this server blocks from”This file is shared, and it holds mostly entries rather than settings. A fresh install ships it empty, so nothing is blocked until you name a list. Deleting the file is the same as an empty one.
One setting turns blocking off for every client:
enabled = false| Key | Default | Range | What it does |
|---|---|---|---|
enabled |
true |
On or off | Whether this server blocks for any client |
With enabled = false, no rule is tested for any client, and the canary and Private Relay
answers are off too. Each query that reaches the blocking test reads disabled in the query log.
It is a revision, so a restart keeps it, and every node of a cluster takes it. The lists stay current while it is off, so
enabled = true blocks again at once, with fresh lists.
tadoru blocking disable is a second state beside this one: a switch in memory that a restart
turns back on. Blocking is in force only where the setting is true and the switch is on. So
tadoru blocking enable turns the switch on, and blocking stays off while the setting is false.
tadoru blocking status, GET /api/blocking/state and GET /api/health say which of the two
keeps blocking off. A start with enabled = false logs a warning that names the setting, and so
does each revision that turns it off while the server runs. A change made with the server
stopped, such as tadoru config rollback or tadoru restore, is warned of at the next start.
Those two commands print a line too.
GET /api/blocking gives enabled as true or false. A PATCH of true or false writes the
key, and a PATCH of null takes it out, so the default true applies. The console sends only
the settings that change, so it writes the key only when somebody changes it. A whole read sent
back with PATCH, as a script can do, writes enabled = true into a file that left it out.
- Before you install an older build, remove
enabledfromblocking.toml, whatever it says. An older build refuses the key, so it refuses the file. A change of the setting in the console writes the key, and so does a whole read sent back withPATCH. Where it wasfalse, turn blocking off on the older build another way: the switch after its start, orbypass = ["0.0.0.0/0", "::/0"].
bypass = ["0.0.0.0/0", "::/0"] does the same, but it reads as a rule for some clients. Write
enabled = false where you mean off for everybody.
Two settings decide how often a list is read:
refresh_hours = 24min_refresh_minutes = 60| Key | Default | Range | What it does |
|---|---|---|---|
refresh_hours |
24 |
1 to 8760 | How often to read a list that names no number of its own |
min_refresh_minutes |
60 |
1 minute to refresh_hours |
The shortest interval this server will use, whatever a publisher declares |
A publisher declares how long their file stays current, and both of the lists this server is
built against say hours. A declared expiry shorter than refresh_hours shortens the interval
for that list, down to min_refresh_minutes. A longer one changes nothing. A list declaring
five minutes is read hourly rather than twelve times an hour. The publisher decides
their cadence, and this machine decides what it can afford.
refresh_hours on a source wins over both. That is an operator naming a number for one list.
Five settings decide what a client hears for a blocked name, and for how long:
mode = "zero"answer_ttl_seconds = 2block_report = true| Key | Default | Range | What it does |
|---|---|---|---|
mode |
"zero" |
zero, nodata, nxdomain, address |
What to answer for a name a rule blocks |
block_v4 |
An IPv4 address | The address to answer for A, where mode is address |
|
block_v6 |
An IPv6 address | The address to answer for AAAA, where mode is address |
|
answer_ttl_seconds |
2 |
0 to 86400 | How long an address answer or a TXT report lives |
block_report |
true |
On or off | Whether a TXT question about a blocked name explains it |
zero answers 0.0.0.0 for A and :: for AAAA, and an empty answer for anything else. It is
the default because it keeps a client talking to this server. A browser with its own resolver
reads nxdomain as a broken one and looks for another. nodata answers nothing at all, for
every type including addresses. That is what a blocker rule asks for with ;reply=NODATA.
nxdomain says the name does not exist, for every type. A resolver can take that to mean that
nothing under the name exists either. So it blocks harder and can break a name nobody blocked.
address answers one address you choose, or both. With only block_v4 or only block_v6 set,
the other type gets an empty answer instead of a guess.
The server refuses block_v4 or block_v6 where mode is not address. It also refuses
mode = "address" with neither address set. A setting the server does not act on is a setting
that lies.
answer_ttl_seconds is short on purpose. An operator allows a name, and a client holding a five
minute answer keeps failing for five minutes. At two seconds it works before they finish reading
the page. The cost is one query per client every two seconds for a name that stays blocked. A
blocked answer costs only a few microseconds, because nothing asks an upstream for it.
block_report answers a TXT question about a blocked name with the list and the rule. A device
that cannot read the query log still learns why a name failed. Turn it off, and a TXT question
gets whatever mode says for a type it has no answer of its own for.
bypass = ["192.168.1.10", "192.168.10.0/24"]| Key | Default | Range | What it does |
|---|---|---|---|
bypass |
Empty | Up to 64 addresses or subnets, either family | A client no rule ever blocks |
An address in bypass is answered as though no rule matched it. A subnet does the same for
every address inside it. It is written as the address of the range, then / and the bits that
decide it: 192.168.10.0/24 covers 192.168.10.0 through 192.168.10.255. The address has to
be that range’s own: 192.168.10.5/24 is refused, and 192.168.10.0/24 is what it means.
It is meant for one machine that has to keep working while you tune the rest. A wide prefix
bypasses many clients at once. 0.0.0.0/0 bypasses every IPv4 client this server hears from, and
::/0 every IPv6 one, so the pair stops blocking for everybody. Two narrower ways exist:
blocking = false on a group, and the timed disable over the API.
cname_blocking = true| Key | Default | Range | What it does |
|---|---|---|---|
cname_blocking |
true |
On or off | Test the names inside an answer, not only the name asked for |
A site can publish metrics.example.com as an alias for tracker.adtech.test. The name a browser
asks for then belongs to the site, and the answer belongs to the tracker. No list can hold the
first name, because it is different for every site. With this on, the server follows the alias chain in the answer and blocks the answer
where a name in it is blocked. The query log says which name matched and what the whole chain was.
Turn it off, and only the name asked for is tested. This is the answer for every group. A group in
clients.toml can write its own cname_blocking. That group keeps the rest of its rules. It is the
answer for a group that has to tolerate one vendor’s aliases.
An allow entry exempts the name it is about and nothing else. So allowing the name a browser asks for does not allow the tracker behind it. Allow the name in the chain that matched, which the query log names.
canary = trueprivate_relay = "allow"| Key | Default | Range | What it does |
|---|---|---|---|
canary |
true |
On or off | Tell Firefox that this network filters DNS |
private_relay |
"allow" |
"allow", "block" |
Let an Apple device start Private Relay, or refuse it |
Two settings decide the names this server answers about itself. Neither name comes from a list, so
no allow entry changes either answer. Everything that stops filtering does stop them: a bypass
address, a group with blocking = false, and tadoru blocking disable. A server that filters
nothing must not tell Firefox that it does.
A group can write either setting for itself, and the rows further down this page say so. false
and "allow" mean “treat these names like any other name”, so a list that holds one of them still
blocks it.
canary = true answers use-application-dns.net with NXDOMAIN. Firefox asks for that name before
it turns on its own encrypted resolver. The NXDOMAIN tells Firefox to keep the resolver this network
gave it. With it off, Firefox can resolve names itself and this server sees none of
that browser’s queries. Turn it off on a server that filters nothing.
private_relay = "block" refuses mask.icloud.com and mask-h2.icloud.com, which are the names an
Apple device starts Private Relay through. The device then sends its queries here. The default is
"allow", because Private Relay is a feature people pay for.
Neither setting is a firewall rule. A device that carries a resolver address of its own, such as a
television with 8.8.8.8 compiled in, goes around this server whatever these say. Block outbound
port 53 and port 853 on the router for everything except this server.
Blocking has the rest of that, including the resolvers that answer on port 443.
Six more settings decide whether a body that arrived is worth serving. A body that fails one is not served, and the source keeps what it had. So these stop a maintenance page, or a download that a proxy cut short, from becoming a list that blocks almost nothing.
| Key | Default | Range | What it refuses |
|---|---|---|---|
max_source_bytes |
67108864 |
1024 to 134217728 | A body holding more decoded bytes than this |
max_invalid_percent |
20 |
0 to 100 | A body with more of its rule lines than this holding no usable name |
min_rules |
100 |
1 to 10000000 | A published list compiling to fewer rules of its action than this |
min_share_percent |
50 |
0 to 100 | A body keeping less of what the source held before |
max_compiled_bytes |
268435456 |
1024 to 268435456 | A compiled set bigger than this |
max_count_drift_percent |
5 |
0 to 100 | A body reading further below its own declared count than this |
Every one of those six is also a key on a source, and a source’s own number wins. A publisher
who lists forty names is real, and their min_rules is their own business. Three of the six turn
their check off at the end of their range: min_share_percent = 0, max_invalid_percent = 100
and max_count_drift_percent = 100. Each of those is for a publisher whose file is unusual in
that one way. Each is a check this server then does not make.
A source with a path starts from a floor of one rule rather than a hundred. A file in
the config root is what you typed, and three names are three names. It is a default and not an
exception. min_rules at the top of the file applies to that source as well. min_rules on
the source itself is how you give it a floor of its own. A file of no rules at all is refused
whatever you write, because that is a truncation.
A change to one of these twelve settings reads that source again at once. So a number you write
to get past a refusal is tried while you are still watching. A change to url, path,
action, subtree, exceptions or format does the same. The first two change where the list comes from, and
the last four change what its lines mean.
max_compiled_bytes lowers the limit rather than raising it. Its range ends at its default.
A compiled set bigger than that is one this server writes and then cannot read back at
the next start. max_source_bytes goes to twice its default, and the body kept beside the
compiled list reads back at that size too.
This build reads the file and checks it. It refuses a revision that names a source or a name it cannot use, and the refusal says which one. It reads every source it names once when the server starts, and then on that source’s own interval. A change to this file reads the sources whose settings changed, at once, and leaves the others on the interval they were already on. The log says what each one held:
INFO read a blocklist source source="hagezi-pro" lines=223233 rules=223220 duplicates=0 ignored=13 unsupported=0 invalid=0Compare rules with the count the publisher declares in their own header. Every interval
carries up to a tenth of itself as jitter, so every server does not ask its publisher at the
same moment. A source that did not arrive is tried again in half a minute rather than at its
next interval. A list file that the running revision does not hold, or holds damaged, is the one
exception. It waits its interval, because the revision does not change in half a minute. The
next revision makes it due at once. A source whose url you change is read at once, whatever its
interval says.
A source that cannot be fetched, or that holds too little to be a list, is a warning rather
than a stop, and the server keeps answering. A machine whose certificate store this build
cannot read fetches nothing over HTTPS, and it still reads a path source.
Ask about a blocked name to see the default shape:
dig @127.0.0.1 -p 5300 ads.example.com A +shortThis server caches nothing here. Turning a rule off, or changing mode, takes effect at once.
The query log row for a blocked query says which list and which rule, which
The query log shows.
An address mode with both families set looks like this:
mode = "address"block_v4 = "192.0.2.1"block_v6 = "2001:db8::1"A source is a list somebody publishes. It needs an id you choose and one place to read from:
[[source]]id = "hagezi-pro"url = "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/wildcard/pro-onlydomains.txt"
[[source]]id = "ours"path = "blocklists/ours.txt"subtree = falseexceptions = "global"
[[source]]id = "fixes"url = "https://example.net/lists/allow-common-breakage.txt"action = "allow"| Key | Default | Range | What it does |
|---|---|---|---|
source |
Up to 64 entries | One [[source]] per list, tried in the order written |
|
id |
Lower case, digits, - |
What to call it, 40 bytes at most | |
url |
An https address |
Where to fetch it. Plain http is refused |
|
path |
Inside the config root | A file to read instead of a URL | |
private |
false |
On or off | Whether the url may lead to an address of your network. An admin sets it |
action |
"block" |
block or allow |
What the rules of the list do |
subtree |
true |
On or off | Whether a plain name in it covers the names under it |
format |
"auto" |
auto or abp |
Which dialect to read it as |
exceptions |
"source" |
source or global |
Whose blocks this list’s own allow rules cancel |
refresh_hours |
1 to 8760 | How often to read this one list. It wins over the file’s number and over the publisher’s own expiry | |
max_source_bytes |
1024 to 134217728 | The most decoded bytes this one list may hold | |
max_invalid_percent |
0 to 100 | How much of this one list may hold no usable name | |
min_rules |
1 to 10000000 | The fewest rules of its action this one list may compile to | |
min_share_percent |
0 to 100 | How much of what this one list held before it must keep | |
max_compiled_bytes |
1024 to 268435456 | The most bytes this one list’s compiled set may take | |
max_count_drift_percent |
0 to 100 | How far below its own declared count this one list may read |
An id names three things: the files this server writes the compiled list to, and the column a blocked query’s row carries. It also names the list an operator hears back over a TXT question. So two sources cannot share one.
A url is https only. A list over plain HTTP is a list anybody on the path can edit.
What they edit is which names this server refuses to answer. A path is relative to the
config root, with no leading slash, no .., and no symbolic link along it. It names a file, not
the config root itself. No part of it is a name that the config root skips.
Such a part starts with . or ends with ~ or .tmp, or matches one of those in another case.
bootstrap.toml at the top is skipped too. Write the path in the case of the file. A source names a url or a
path, never both.
format = "auto" reads each line as what it is: a plain name, a hosts line, or an Adblock Plus
rule. That reads a list published in Adblock syntax without being told. format = "abp" reads
only the Adblock forms and counts everything else, which is how you notice a list that changed
shape. Blocking says which forms are read.
subtree on means an entry for example.com blocks example.com and
subdomain.example.com, and does not block thiseexample.com. That is what both publishers
mean by their plain-domain files. A list whose entries mean the exact name and nothing else
wants subtree = false.
exceptions = "source" keeps a list’s own allow rules inside that list. global lets them
cancel every source. Give that to a publisher you trust with the whole policy. Otherwise an
advertising list that allows a name turns off a malware list somebody else maintains.
action = "allow" makes a list of names to allow. Every rule of it allows its name, a plain name
and a ||name^ line alike. It cancels every block of the groups that use it: the other
lists, your own [[block]] entries and the group’s own block names. Give that to a list you
trust with the whole policy of those groups, for the same reason. An allow source takes no
exceptions, because it already cancels every block. Its min_rules counts its allow rules.
Blocking has the rest.
- Before you install an older build, remove each allow source whole: its
[[source]], and its id in eachsources = [...]ofclients.toml. Never removeactionalone. An older build refuses the key, and without the key it reads the source as a block list, so its names to allow become names to block. The older build has no allow source. Its nearest form is[[allow]]entries, 10,000 at most. Also remove each otheractionline of a[[source]], such asaction = "block". Make the change while this build runs. Then start the older build on a copy of the config root with a new, empty state root, as the bullet on large list files below says.
Blocklist sources on your network
Section titled “Blocklist sources on your network”Every hop of the fetch of a url reaches a public address or the fetch ends, the first one
included. private = true lets the fetch reach an address of your network, for a list served by a
machine of the house or by this one:
[[source]]id = "house"url = "https://nas.lan/blocklist.txt"private = true- It covers the host and the port that the
urlnames. A redirect to another host, or to another port, still reaches a public address alone. - It allows the private ranges, loopback, carrier-grade NAT, unique-local IPv6 and the prefixes of
rebind_inside. It never allows the unspecified address, link-local such as169.254.169.254, multicast or broadcast, in any form. - A
pathsource takes noprivate = true. - Only an admin adds the key, adds a source that holds it, renames such a source or points it at another URL. An operator can change its other keys, take the key out or delete the source. The server’s own uid or root on the management socket, with no credential, counts as an admin here, because it can write this file already.
- Through the outbound proxy, the server sees no address of a name. A role below admin adds a
urlthat goes through the proxy only from the catalog of known lists, and an admin adds any other. Only an admin sendsurlsources through a proxy, its kind and its address, that no list fetch of the running revision went through. That is anotheroutbound_proxy, a new one, or one that sat unused while the lists went direct. The proxy is where the fetch connects first. Taking the proxy away needs no admin. - A read of
GET /api/blockinggivestrueornull, and a file written back holds the key only where it istrue. A build before the key refuses a file that holds it.
Blocking says what the rule refuses and where it stops.
Your own entries go in the same file. Your allow entries beat every list, and your blocks beat
every list but an allow source and an @@ line of a source with exceptions = "global":
[[block]]name = "ads.example.net"note = "the smart television"
[[allow]]name = "clicks.example.com"note = "the shop we buy from sends order mail through this"| Key | Default | Range | What it does |
|---|---|---|---|
block |
Up to 10000 entries | Names you block whatever a block list says | |
allow |
Up to 10000 entries | Names you allow whatever the lists say | |
name |
A name | The name, which covers the names under it | |
note |
Text | Why, for whoever reads the file in a year |
An allow entry of yours cancels every block, from every list. You looked at the name and decided. Nothing reads a note. The audit trail keeps the change that added it, so the note is in the history with the rest of the file.
A [[regex]] rule matches a name by its shape instead of by the name:
[[regex]]pattern = "^ad[sx]?[0-9]*\\."note = "the hosts the lists keep missing"
[[regex]]pattern = "\\.metrics\\.example\\.com$"action = "allow"qtype = ["A", "AAAA"]groups = ["work"]| Key | Default | Range | What it does |
|---|---|---|---|
regex |
Up to 200 rules | One [[regex]] per pattern rule |
|
pattern |
An expression, 1024 bytes at most | What to match the name against. It is required | |
action |
"block" |
block or allow |
What a match does |
qtype |
Up to 16 distinct query types | The types this rule is about, and every type where the key is absent | |
invert |
false |
On or off | Whether the rule fires for the names the pattern does not match |
mode |
zero, nodata, nxdomain, address |
What to answer for this one rule, instead of the group’s answer | |
block_v4 |
An IPv4 address | The address this rule answers for A, where its mode is address |
|
block_v6 |
An IPv6 address | The address this rule answers for AAAA, where its mode is address |
|
groups |
Names clients.toml declares |
The groups this rule is about, and every group where the key is absent | |
note |
Text | Why, for whoever reads the file in a year |
A pattern rule is the last thing tested, after your own entries and after the lists. So an allow
entry of yours answers before any pattern runs. An allow pattern still cancels a block that a
list found. A blocked row reads regex in its rule kind column, and it names
the pattern rather than a list.
The pattern is matched against the name in lower case with no trailing dot, and it is matched
unanchored. So ads\. matches ads.example.com and img.ads.example.com, and ^ads\. matches
the first alone. Capital letters in a pattern match either case, by the Unicode rules, so a letter
such as ſ matches s. A pattern that means one exact name belongs in [[block]].
Every . in the text you match against is a boundary between two labels. A name can hold a dot
inside one label. The text writes that dot as %2e, so \. in your pattern always means a
boundary. Every byte that is not a-z, 0-9, - or _ is written the same way: % and two
lower case hex digits. Write %25 for a name that holds a real %.
invert = true is the sharp one. It turns the rule inside out, so a block rule blocks every name
the pattern does not match. When you mean it, that is a walled garden for one machine. When
you do not, nothing resolves. An inverted rule costs what any other rule costs, and it has no limit
of its own. The limits above count it with the rest.
A file this server cannot use is refused, and the last good configuration keeps serving. These are refused:
- an id that is not lower case letters, digits and hyphens
- two sources with one id
- a source with both
urlandpathor with neither - a plain
httpurl - a url with a credential in it
- a path that leaves the config root or goes through a symbolic link
- a path that the config root skips or that names the file in another case
- an
actionor anexceptionsthat is not one of the two words exceptionson an allow source- a name this server cannot look up
- a count past one of the limits above
A pattern rule is refused for any of these:
- an empty
pattern, or an expression this server cannot compile - an
actionthat is neither word - a
qtypeor agroupsthat is empty - a query type or a group name this server does not read
- a group name no
[[group]]inclients.tomldeclares - an address where
modeis notaddress - a
modeon an allow rule, which answers nothing - patterns that together build a program the engine calls too large
Each refusal names the source, the entry, or the rule by its position. The last one in the list above names no rule, because it is about every pattern of the file together. It says how many patterns there were and the limit. Troubleshooting has what to do about one.
A path source is read from the config root, so the list is part of every revision and every
backup. A list file under blocklists/ holds 16 mebibytes, about 600,000 names, and a list file at
another place holds the 4 mebibytes of every other configuration file. A larger list belongs at a
url. The kept revisions can share one copy of a file under blocklists/ that did not change. So
a list does not cost 16 mebibytes for each change of the settings beside it. A file at another
place stays a copy in each revision. So does a file under blocklists/ whose mode or access list
changed, or one on a disk that takes no hard link. A restore writes each file as a copy.
A list file can hold bytes that are not UTF-8, such as a list in Latin-1. Each line with such a
byte is an invalid line of the list, which counts against max_invalid_percent. A list file that
is not text enters a revision as any edit does, where a path source names it. That source is one of the
running blocking.toml, or of the blocking.toml that the same save changed.
A file that is not text and that no source names stays out of the revisions after the first start.
The log says a new file is not text and no path source names it, so it is left alone. Where a source names
the file in another case, such as path = "blocklists/Latin.txt" for blocklists/latin.txt, the
log says a path source names it in another case instead. Change path to the name of the file.
A settings file or a file of a zone takes no such bytes, even where a source names it. The first
start takes every file of the config root, so it can hold one. A rollback, a backup and a restore
keep the bytes as they are. tadoru config edit and tadoru config apply read a file as text. So
they refuse a list file that is not UTF-8. tadoru config show replaces each sequence that is not
UTF-8 with U+FFFD (the replacement character), and does not keep the bytes.
A rename of a list file that changes only its case, such as blocklists/home.txt to
blocklists/Home.txt, together with its path, is refused in either order. Each change meets the
other spelling, a name in another case. The revision keeps the old file, and the config root holds
the new one. Rename in two saves instead: first to another name, such as blocklists/home-2.txt,
with its path, then to the name you want, with its path.
- Before you install an older build, remove each file under
blocklists/past 4 mebibytes, whether or not a source reads it. Remove the source that reads it too, and its id in eachsources = [...]ofclients.toml. Make the change while this build runs, so that it takes the change as a revision and writes it into the config root. An older build holds every such file to 4 mebibytes, so it refuses a config root that holds one. A build from before allow lists is also a build before schema 24 ofcontrol.sqlite, so it does not open the state root of this build. After the change, start the older build on a copy of the config root with a new, empty state root, as Going back to an older build says. That start is a first start: the accounts, the history of revisions and the rest of the state root of this build stay behind.
clients.toml: who is asking
Section titled “clients.toml: who is asking”This file gives a name to a client. One query is one client. A query that matches nothing is
the client default, which every server has and no entry declares. The name goes in the query
log, so a row says kids-tablet beside the address. A name alone changes no answer: a client with no group key is in the group default, as an unnamed query is. The group key gives it a policy of its own (Groups). Clients is the page about naming one.
[[client]]name = "kids-tablet"addresses = ["192.168.1.42"]
[[client]]name = "guest-network"subnets = ["192.168.20.0/24", "2001:db8:20::/64"]
[[client]]name = "iot"arrived_on = ["10.0.5.53"]| Key | Default | Range | What it does |
|---|---|---|---|
client |
Up to 256 entries | One [[client]] per client you name |
|
name |
Lower case, digits, - |
What to call it, 40 bytes at most | |
addresses |
Addresses, either family | Clients at these addresses | |
subnets |
Subnets, either family | Clients inside these ranges | |
arrived_on |
Addresses of this server | Clients that asked one of these listen addresses | |
group |
A group this file writes | Which group this client is in |
The file is optional. A server without it names no client, and every query is default.
One client carries entries of all three kinds, and 64 selectors in total. A selector is one
address, one subnet, or one arrived_on address.
Three kinds, and a fixed order. The order the file writes them in changes nothing:
- An
addressesentry that is the address that asked. - The narrowest
subnetsentry that holds it.192.168.20.32/27wins over192.168.20.0/24. - An
arrived_onentry that is the address of this server the query arrived on. - Otherwise the client
default.
arrived_on names a client by the door it came through rather than by where it came from.
Give the guest network its own listen address, put that address in arrived_on, and a query
through it is that client whatever address asked. It is the third rank, so an addresses or
subnets entry that covers the asking address still wins.
A file this server cannot use is refused, and the last good configuration keeps serving.
Two clients cannot name one selector. That covers one address, one subnet, one arrived_on
address, and one address written once bare and once as a whole subnet. Each refusal names
both clients. These are refused too:
- One name twice, and a client called
default. - A client with no selector at all.
- A name that is not lower case letters, digits and hyphens.
- A subnet under
addressesor underarrived_on. - A
/0subnet, and a link-local IPv6 address anywhere. - A subnet that holds the whole of
fe80::/10, such asfe00::/8. - A count past one of the limits above.
Groups
Section titled “Groups”A group is a blocking policy that a set of clients share. Every client is in one group. A
client with no group key is in the group default, which every server has.
A group decides what a query is tested against. The order is the disable switch first, then
the bypass list of blocking.toml, then the group. After that come the allow names, the
group’s own before the ones in blocking.toml. A source set to exceptions = "global" has
its own allow lines read here as well, before any block. Then come the block names, the
group’s own before the ones in blocking.toml. The group’s sources come last, in the order
the group names them.
So a group allow name beats a block name in blocking.toml. Every allow name is read
before every block name, so this holds the other way as well: an allow name in
blocking.toml beats a group’s block name. A blocked query’s log row names the group that
blocked it.
[[group]]name = "kids"sources = "all"block = ["games.example.net"]mode = "nxdomain"
[[client]]name = "kids-tablet"addresses = ["192.168.1.42"]group = "kids"| Key | Default | Range | What it does |
|---|---|---|---|
group |
Up to 64, counting default |
One [[group]] per policy you write |
|
name |
Lower case, digits, - |
What to call it, 40 bytes at most | |
sources |
"all", or up to 64 source ids |
Which lists this group uses. Required | |
blocking |
true |
true or false |
Whether this group is tested at all |
block |
Up to 1000 names | Names this group blocks, and the names under them | |
allow |
Up to 1000 names | Names this group allows, and the names under them | |
cname_blocking |
true or false |
Whether the names inside an answer are tested for this group | |
canary |
true or false |
Whether Firefox is told that this network filters DNS, for this group | |
private_relay |
"allow", "block" |
Whether this group’s devices can start Private Relay | |
mode |
zero, nodata, nxdomain, address |
What to answer this group for a blocked name | |
block_v4 |
An IPv4 address | The address to answer for A, where mode is address |
|
block_v6 |
An IPv6 address | The address to answer for AAAA, where mode is address |
sources = "all" means every source that is enabled, including one you add tomorrow. A list
names the ids you want and nothing else. The key has no default, because “every list” and “no
list” are too far apart to guess between.
A group states its whole blocked answer, or none of it. A group with none of mode, block_v4
and block_v6 takes the answer blocking.toml gives. A group that writes any of the three
states all of what it wants: mode = "address" with only block_v4 answers nothing for AAAA,
the same as blocking.toml with only that key. There is no key by key default, so block_v4
without mode = "address" is refused rather than half read.
blocking = false tests nothing at all for that group, its own block names included. The
lists you wrote stay in the file, so turning the group back on needs one line changed.
cname_blocking in a group covers that group alone, and a group without the key takes the answer
blocking.toml gives. Write cname_blocking = false for a group that keeps every
list and still has to reach one service. blocking = false is the bigger hammer, because it takes
every rule away from the group.
canary and private_relay work the same way, one group at a time, and a group without the key
takes the blocking.toml answer. They are the one pair of settings blocking = false does not
turn off. A group with blocking = false and no canary key still answers the canary domain
NXDOMAIN, because the group setting is what turns that answer off.
default is a group you can write. A [[group]] named default changes the policy every
client without a group key already runs on, and it does not add a second group. That is how
you put the whole house on one list without naming a group on every client.
These are refused as well:
- A
[[group]]with nosourceskey. - A
sourcesword that is not"all". - One group name twice,
defaultincluded. - One source id twice inside one group.
- A
groupkey on a client that no[[group]]in this file declares. block_v4orblock_v6in a group with nomode = "address".- A
private_relayword that is not"allow"or"block", in a group or inblocking.toml. - More than 64 groups, counting
default, or more than 64 sources in one group. - A source id in
sourcesthatblocking.tomldoes not define.
The last one is the only refusal that reads both files. The message names the group, the id you
wrote and the ids that file defines. sources = "all" names no id. When you add a source, a
group written that way needs no edit here.
To rename a source, take these three steps in this order. Each step is a revision that stands on its own, so nothing is refused along the way:
- Add the new id in
blocking.toml. - Switch the groups in
clients.tomlto the new id. - Delete the old id from
blocking.toml.
Delete the old id first and you get a revision where a group names an id that is gone. That revision is refused, and the last good configuration keeps serving.
Troubleshooting has what to do about a refusal.
A /0 subnet is refused because default already means every query. It also hides every
arrived_on entry, because a subnet is read first.
A link-local IPv6 address, such as fe80::1, names a different machine on every link, so no
rule is about one. A wider subnet that holds the whole range is the same mistake spelled
differently. An IPv4 link-local address, such as 169.254.1.5, names one machine the way any
other IPv4 address does, so this server takes it.
zones/<zone-id>/zone.toml: a name this server holds records for
Section titled “zones/<zone-id>/zone.toml: a name this server holds records for”A local zone is a directory under zones/. A primary zone holds two files. zone.toml says what
the zone is called. records.zone holds the records, as a master file of the kind BIND reads. A
stub that learns its servers from primaries holds zone.toml alone.
This server answers from a zone it holds, and a zone that does not read is a refused revision. Local Zones has the record format, the lookup and what this build leaves out. This section is the two files and their keys.
zones/ home-arpa/ zone.toml records.zonename = "home.arpa"kind = "primary"| Key | Default | Range | What it does |
|---|---|---|---|
name |
A domain name, not the root | What this zone answers for. Required | |
kind |
"primary" |
primary, stub or secondary |
Where the records are |
enabled |
true |
true or false |
Whether the zone is served |
primaries |
1 to 8 addresses, port 53 when left out | Where a stub or a secondary asks | |
dnssec |
"validate" |
validate or insecure |
Whether the answers under a stub are validated |
rebind_protection |
true |
true or false |
Whether a stub refuses private addresses |
default_ttl |
From [zones] |
0 to 2147483647 seconds | The lifetime of a record that the API adds |
ns_ttl |
From [zones] |
0 to 2147483647 seconds | The lifetime of an NS set that the API adds |
record_expiry |
false |
true or false |
Whether a record takes an expiry time |
serial |
From [zones] |
increment, unixtime or date |
How the server moves the serial of this zone |
query_from |
From [zones] |
Up to 64 entries | The networks whose clients get answers here |
min_refresh |
From [zones] |
60 to 2147483647 seconds | The least time between two checks of the copy |
max_refresh |
From [zones] |
min_refresh to 2147483647 seconds |
The most time between two checks of the copy |
min_retry |
From [zones] |
10 to 2147483647 seconds | The least wait after a failed check |
max_retry |
From [zones] |
min_retry to 2147483647 seconds |
The most wait after a failed check |
default_ttl, ns_ttl, serial and query_from are the keys of the same names in the [zones]
table of server.toml, for this zone alone. The value here wins over the table
(Defaults of a zone). A key you leave out takes the value of the table. They
are keys of a primary alone, but query_from is a key of a secondary too.
serial acts on the next dynamic update and the next zone thaw --serial-bump. query_from acts
on the next query. default_ttl and ns_ttl act on the next POST /api/zones/{id}/records. A new NS set
there with no lifetime takes the most specific key: ns_ttl here, then ns_ttl of [zones], then
default_ttl here, then default_ttl of [zones].
POST /api/zones and PUT /api/zones/{id}/import with name
write serial into the zone.toml of a new zone where the request names a scheme. The first
serial of POST /api/zones is the first step of that scheme. The serial
says more.
record_expiry = true makes the mark ;expires= of records.zone the expiry time of its
record: the time at which the record is to leave the zone. Without it, the mark is the text of a
comment. It is a key of a primary whose records are one file, so a stub and a zone that $INCLUDE
splits refuse it. A change that turns it on is refused where the zone holds an expiry time at or
before the time of the change. It is refused too while the clock gate does not trust the clock. A
change that turns it off is refused while the zone holds an expiry time. The server reads the zone
for both with the changes of its journal. A rollback to a revision without the key is taken, and
clears every expiry time. A mark of its files stays as the text of a comment, which a later turn
on judges again. The expiry time of a record says more.
A zone with a query_from narrower than the zone of an ANAME that points into it is refused.
The addresses of the ANAME go to every client of the owner’s zone. That holds for every zone
that the target reaches through a CNAME or a DNAME of your zones. An ANAME that a zone refuses has the message.
A primary zone holds its records here, in records.zone. A stub zone is on other servers,
and this server knows their names. A stub takes its name servers from primaries, or, without
primaries, from its records.zone. A stub with primaries has no records.zone.
dnssec and rebind_protection are keys of a stub alone, and primaries a key of a stub or a
secondary. [[update.allow]] is a key of a primary alone, and [[transfer.allow]] and notify
keys of a primary or a secondary. dnssec and rebind_protection work as they do in [[forward]].
This build serves both kinds of stub (Local Zones). A static stub has its servers in
its records.zone. A stub with primaries learns them from the first primary that answers, and
keeps them in STATE_ROOT/zones/<zone-id>/stub.zone. A primary is asked with the outbound settings
of the walk: upstream_timeout_ms of server.toml, and outbound_addresses and exclude_ports
of node.toml. A name server on this machine, such as 127.0.0.1:5353, can be a primary. A stub
and a [[forward]] for one name are refused, and so is a stub at the name of a primary zone.
A secondary zone
Section titled “A secondary zone”A secondary zone copies its records from its primaries by zone transfer. This build reads and
checks the kind, and the server does not serve one yet: a change that writes one is refused, a
hand edit and the first start that adopts the configuration root too. tadoru config validate
takes it.
# zones/corp-example/zone.toml: a copy of corp.example from the domain controllername = "corp.example"kind = "secondary"primaries = ["10.0.0.53", "[2001:db8::53]:5300"]min_refresh = 300A secondary holds zone.toml alone. A records.zone or another master file beside it is
refused, because its records come from the primaries. It needs primaries, 1 to 8 addresses in
the form of the primaries of a stub. It takes enabled, query_from, notify and
[[transfer.allow]] as a primary does. [[update.allow]], default_ttl, ns_ttl, serial and
record_expiry are keys of a primary, and dnssec and rebind_protection keys of a stub, so a
secondary refuses them. A secondary counts toward the 200 zones.
min_refresh, max_refresh, min_retry and max_retry bound the timers of the SOA of the copy.
The refresh is held between min_refresh and max_refresh. The retry is held between
min_retry and max_retry, then to at most the refresh. A key here takes the place of the key of
[zones], and the keys you leave out come from the table. So a
min_refresh here above the max_refresh of the table is refused, and the refusal names the key
of this file. A primary and a stub refuse the four keys.
A zone with enabled = false stays in the configuration with its journal. Its own records are
read and checked. The checks between zones, and against server.toml, wait until it is turned on,
so turning it on can be refused. It answers no name, and it takes no update. A name of it goes to the next
zone or route that holds the name. That is a zone of yours above it, a [[forward]], a zone that this
server holds itself, such as home.arpa, or the upstream. tadoru health names the zone as
turned off. Set enabled = true, or delete the line, to serve the zone again.
The directory name is the zone’s identity, and name is what the zone answers for. They are
not the same string. home-arpa holds home.arpa above, and the directory is what a rollback
and the audit trail follow. So you can change what a zone answers for and keep its history.
A directory name uses lower case letters, digits and -, and 40 bytes at most. Pick one that
reads like the name: home-arpa for home.arpa.
Both files of a primary are checked together, and a primary with one of the two is refused. The records cannot
be read without the name, because every owner in the file is read against it. So adding a zone
is one change that carries both files. tadoru config validate zones/home-arpa takes the
directory rather than either file.
Every zone change this server has not applied yet is judged together, as one change. A rename is
one zone that leaves and one that arrives, and one change carries both, so the zone survives it.
The cost is that one zone which does not read refuses every zone change beside it, including one
you save later. Fix that zone, or move it out of zones/, and the rest applies. A zone you
deleted comes back on disk until the change goes through.
A file under zones/ that is neither zone.toml nor records.zone is refused, and so is a
directory inside a zone. A note beside server.toml costs nobody an answer, and a stray file
under zones/ looks like a zone this server answers for. What your editor leaves behind is the
exception: a name that starts with ., or ends with ~ or .tmp, is skipped here and
everywhere else in the config root. A change cannot write a file under such a name:
tadoru config apply and tadoru config edit refuse it, and so does the server.
A new file name is ASCII. A volume that folds Unicode case or normalization, such as APFS or HFS+
on a Mac, takes ſ.md (with a long s) for s.md. A volume that ignores case takes Notes.md for
notes.md. Two such names in one revision land on one file there, on this machine or at a
restore. That revision then fails its check.
So a change that adds a name outside ASCII is
refused, through the API, tadoru config, or a hand edit. So are two names that differ in case
alone, of files or of the directories on the way to them, such as Notes/a.md beside
notes/b.md, unless the running revision already holds both. A rename of an ASCII name that
changes the case alone lands, by hand too.
A name outside ASCII that the running revision already
holds stays. You can edit it, delete it, and add files below such a directory, and a rollback puts
one back. A first start holds no revision, so a name outside ASCII stops the start: rename the
file to ASCII and start again. One pair is not caught: a new ASCII name beside a held name outside
ASCII that a volume folds to it, such as s.md beside an older ſ.md. Rename the older one to
ASCII.
The limits are:
- 200 zones.
- 100,000 records in one zone.
- 300,000 names in one zone.
- 1,000,000 records in all zones together.
- 3,000,000 names in all zones together.
- A chain of 8 aliases.
A revision past one of them is refused, and the message names the number.
The name limit is the one to know about, because a zone names more than it lists. A record for
a.b.c.example names b.c.example and c.example as well, so 30,000 names of ten labels reach
the limit while the file looks small.
Updates: [[update.allow]]
Section titled “Updates: [[update.allow]]”The server applies an update that these rules cover, and refuses one that they do not. It reads the rules again when the update reaches its zone. So a rule that you narrow or remove while an update waits refuses that update. NOERROR means that the change is in the journal of the zone on the disk, and the next query reads it.
A zone takes no update until its zone.toml names who can send one. An update is a DNS message
that adds or removes records, such as the one a DHCP server sends for the name of a laptop. Each
[[update.allow]] is one rule: the networks a sender comes from, and the names and the types it
can change.
name = "home.arpa"kind = "primary"
[[update.allow]]from = ["192.168.1.2/32"] # the DHCP servernames = ["*.dhcp.home.arpa"]types = ["A", "AAAA", "TXT", "DHCID"]udp = true
[[update.allow]]from = ["192.168.1.0/24"]names = ["printer.home.arpa"]types = ["A"]| Key | Default | Range | What it does |
|---|---|---|---|
update |
A table that holds allow |
Who can update the zone. Without it, nobody | |
update.allow |
One rule or more | The rules, one [[update.allow]] each |
|
from |
Addresses or ranges, one at least | The networks a sender comes from | |
names |
Names in the zone or *. and a name, one at least |
The names the rule covers | |
types |
Type names, one at least, or * alone |
The types the rule covers | |
udp |
false |
true or false |
Whether the rule takes an update over UDP |
*.dhcp.home.arpacovers every name belowdhcp.home.arpa, and not that name itself.- A range is written as
192.168.1.0/24, and its address has no bit set past its prefix. An IPv4 range written in IPv6 form, such as::ffff:192.168.1.0/120, is refused, because a sender of it arrives as an IPv4 address. So are::/96and each range inside it. A range that holds nothing but::and::1, such as::/127, is read. A link-local IPv6 address or range, such asfe80::1, is refused, because it names a different machine on every link. A range of every address, such as0.0.0.0/0or::/0, is refused too, because a rule names the networks it trusts. typesnames types that a record has. A type that only a question or a message carries, such asANY,AXFR,OPTorTSIG, is refused. So is a type that only signing a zone makes, such asRRSIGorDNSKEY.- A sender over UDP can forge its address, so a rule takes an update over UDP only with
udp = true. Over TCP, the connection proves that a reply reached the address. That is trust in a network, not proof of a sender: any program on that machine, or behind that NAT, can send.
Transfers: [[transfer.allow]]
Section titled “Transfers: [[transfer.allow]]”A zone can name who can transfer it, in place of the rules of [[zones.transfer.allow]] in
server.toml (Defaults of a zone). A rule here takes the keys of a rule
there.
name = "example.com"
[[transfer.allow]]from = ["192.0.2.53"]
[[transfer.allow]]from = ["198.51.100.0/28"]| Key | Default | Range | What it does |
|---|---|---|---|
transfer |
A table that holds allow |
Who can transfer this zone, in place of [zones] |
|
transfer.allow |
Up to 16 rules | The rules, one [[transfer.allow]] each |
- The rules of
zone.tomlreplace those of[[zones.transfer.allow]]inserver.tomlwhole. A zone that writes no[transfer]takes the rules of[zones]. - A
[transfer]table with no rule closes the zone, whatever[zones]says. Write it as[transfer]withallow = [], or as[transfer]alone. - The rules stand on a primary alone. A stub zone refuses them.
PATCH /api/zones/{id} changes the rules of the zone as one list, such as
{"transfer.allow": [{"from": ["192.0.2.53"]}]}, written as [[transfer.allow]] blocks. Here
[] and null differ. {"transfer.allow": []} keeps or writes a [transfer] table with no rule,
so the zone is closed. {"transfer.allow": null} takes the [transfer] table out, so the zone
takes the rules of [zones] again. A list that checks to the rules of the file changes nothing.
transfer, the table by its own name, is refused with 400: send the list. On a stub zone, a list
and [] are refused with 422 as a key of a primary zone, and null changes nothing.
GET /api/zones/{id} answers the rules of the zone in replication.transfer. {"allow": [...]}
holds the rules of zone.toml, in the order of the file. null means that the zone writes no
[transfer], so it takes the rules of [zones], which GET /api/server answers. {"allow": []}
means that the zone is closed. Send allow back as transfer.allow, or null where
replication.transfer is null, and the PATCH changes nothing.
NOTIFY: notify
Section titled “NOTIFY: notify”A zone can name the secondaries that it notifies when its serial changes, in place of notify of
[zones] in server.toml (Defaults of a zone). NOTIFY
says when a NOTIFY goes out, and from which address.
# zones/example-com/zone.toml: this zone notifies one server, in place of the list of [zones]name = "example.com"notify = ["192.0.2.53"]# zones/lab/zone.toml: this zone notifies nobody, whatever the list of [zones]name = "lab.example.com"notify = []| Key | Default | Range | What it does |
|---|---|---|---|
notify |
From [zones] |
Up to 16 addresses | The secondaries that this zone notifies, in place of [zones] |
- The list here replaces
notifyof[zones]whole. A zone that writes nonotifytakes the list of[zones]. notify = []notifies nobody, whatever[zones]names.- An entry takes the forms of
notifyof[zones], and the same refusals. A refusal names the entry by its place, such asnotify[1]. - The list stands on a primary alone. A stub zone refuses it.
- Write
notifyabove the first[[update.allow]]or[[transfer.allow]]block. A key below a block belongs to that block, and the server refuses the file.
PATCH /api/zones/{id} changes the list as one key, such as {"notify": ["192.0.2.53"]}.
{"notify": []} notifies nobody, and {"notify": null} takes the key out, so the zone takes the
list of [zones] again. PATCH /api/server changes zones.notify the same way. A list that reads
as the one in the file changes nothing, such as ["192.0.2.53:53"] for notify = ["192.0.2.53"].
GET /api/zones/{id} answers the list of the zone in replication.notify, each entry with its
port, such as 192.0.2.53:53. null means that the zone writes no notify, so it takes the list
of [zones], which GET /api/server answers. [] means that the zone notifies nobody. The list,
sent back as notify of a PATCH, changes nothing.
Aging: [update.aging]
Section titled “Aging: [update.aging]”A record that an update adds can age. Where nobody refreshes it for the two intervals, the server
removes it, so the name of a laptop that left the network goes. This release reads and checks
[update.aging], and a later release acts on it. The table goes under [update], beside its rules:
[update.aging]no_refresh_interval = "7d"refresh_interval = "7d"| Key | Default | Range | What it does |
|---|---|---|---|
update.aging |
A table under [update] |
Turns aging on for the records that updates add | |
no_refresh_interval |
"7d" |
1 hour to 365 days | How long after a refresh a further refresh of the record changes nothing |
refresh_interval |
"7d" |
1 hour to 365 days | How long after that a record that nobody refreshed stays |
- A time takes the units of a lifetime in
records.zone:w,d,h,mandsin any case, such as36hor1w, or seconds alone. - A DHCP server must send an update at each renewal, and the refresh interval must be longer than the time between two renewals.
- Where you turn aging on or change an interval, the server removes no record of the zone for one
refresh interval. A stub takes no
[update], so it takes no aging either. - Before you install an older build, remove
[update.aging]from each zone. An older build refuses the key, so it refuses the zone. - Before you install an older build, also run
tadoru zone checkpoint <zone-id>for each zone whose files hold a;refreshed=mark, with or without[update.aging]. The journal of such a zone can hold a time, and an older build stops a zone at an update with a time.
If you remove the rules of a zone while it holds updates that its records.zone does not, the
server writes them into that file as a revision of its own. It looks once a minute, and writes them
five minutes after the last update, or at its next look where that update is older. While other
updates wait, it can wait up to ten minutes more. A restart in that time does not cancel it. The
server does not write a zone that tadoru health names as stopped, or as at_files because
nothing says which updates its files hold. See
A zone that answers SERVFAIL, or takes no update.
Changing a file by hand
Section titled “Changing a file by hand”Edit it, save it, and the watcher notices. A file that validates becomes the next revision, and the running server uses it without a restart. A file that does not validate is refused, the last good configuration keeps serving, and the refusal goes in the audit trail. Troubleshooting shows what a refusal looks like.
Each file you save is its own change, and the zones are the exception. Every zone change waiting to be applied is one change, for the reason the zone section above gives.
Files that you save together are applied one after the other. A stop of the server between two of
them loses none of them: the next start takes the rest of the files that it still finds changed.
A list that is not text, saved with a change of blocking.toml that takes its source away, is no
exception. The server records the list in pending-lists.toml in the state root before it applies
blocking.toml. The next start takes the list from that record, while the file still holds the
bytes that you saved. Where that record does not read, no edit of a file is applied. That holds until
tadoru config recover-pending sets it aside, as
Edits of files that wait for a record of owed lists says.
The command line can check a file before the server sees it, and can submit one whether or not the server is running. The command line has both.
Changing a file over the API
Section titled “Changing a file over the API”GET /api/server and GET /api/node answer with what is running. PATCH changes the
settings a JSON object names and keeps your comments. PUT replaces the whole file with
the text in the body. API Reference has every parameter and every answer.
S=./data/run/api.sockA="authorization: Bearer $TOK"
# What is running, with the revision and its record as an entity tag.curl -s -D - --unix-socket $S -H "$A" http://localhost/api/server
# Change one setting.curl -s -X PATCH --unix-socket $S -H "$A" \ -H 'content-type: application/json' -d '{"max_retries":4}' \ http://localhost/api/server
# Put one setting back to its default.curl -s -X PATCH --unix-socket $S -H "$A" \ -H 'content-type: application/json' -d '{"max_retries":null}' \ http://localhost/api/server
# Replace the whole file. PUT takes the file's text, not JSON.curl -s -X PUT --unix-socket $S -H "$A" \ --data-binary @server.toml http://localhost/api/serverA setting sent as null goes back to its default. The server takes its line out of the file and
keeps the comments above it. The file that a first boot writes has a commented line for most
settings, such as # max_retries = 2. That line comes back in its place, so the file reads as it
shipped. A setting with no default of its own, such as forwarder_timeout_ms, has no such line, so its
null puts nothing back. The file names it in prose, and its first PATCH writes it under that
paragraph. A setting that the file does not hold is no change, and without an idempotency key it
spends no revision. A setting that the file cannot hold is refused, as it is with a value. A null
inside a list is refused. The table zones takes no null whole, whether the file holds it or not.
A null of forward or negative_trust_anchor takes every block of it out of the file, and keeps
the comments above the first block.
forward and negative_trust_anchor take the whole list, as a list of objects:
curl -s -X PATCH --unix-socket $S -H "$A" \ -H 'content-type: application/json' \ -d '{"forward":[{"suffix":"home.lan","to":["192.168.1.1"],"rebind_protection":false}]}' \ http://localhost/api/serverThe list replaces every block of the setting. A PATCH cannot change one entry alone. The server
writes one [[forward]] block per entry, with suffix, to, dnssec, note and
rebind_protection in that order. It leaves out a key at its default, such as
dnssec = "validate", unless the old block at the same place wrote it. A
[[negative_trust_anchor]] gets suffix, until, note and probe.
A key sent as null inside an entry is left out of it.
What happens to your comments:
- The comment lines above the first block stay above the first new block. Those above the second stay above the second, and so on, for each place that the old and the new list both have.
- The comment lines inside a block are lost, and so is a comment after one of its values.
- Where the list gets shorter, the comment lines above each block that goes are lost too. An empty list keeps the comments above the first block.
- A block past the old ones goes at the end of the file, below a comment after the last block, where no table follows the blocks. Where one follows, it goes after the last block. A file with no block gets the blocks at its end.
- A list written in the file on one line, such as
forward = [{ ... }], is not replaced, and the change is refused. Write it as blocks, or send the whole file withPUT.
A list equal to the one that runs is no change. The file stays as it is, comments inside the blocks
too, and without an idempotency key it spends no revision. Equal means equal after the check, so
10.0.0.1 and 10.0.0.1:53 in to are the same, and so are two spellings of one until. A form
that sends back the list it read costs nothing. An empty list, and null, take every block out of
the file. A list of objects for any other setting is refused. To keep notes inside your blocks, edit
the file, or send the whole file with PUT, which keeps the text as you wrote it.
A read answers from the snapshot the query path is using, rather than from the file on disk. The two differ for the moment between a write and its activation, which is exactly the moment somebody is watching.
There is deliberately no PUT of a JSON object. Writing one back means naming every
setting, and a file that names every default never receives an improved default from an
upgrade.
Four rules for a configuration change
Section titled “Four rules for a configuration change”These four govern the configuration routes: PATCH and PUT of /api/server and
/api/node, and the rollback. An account, a token, a password, a session and a redaction
are their own operations, and they use neither If-Match nor an idempotency key.
If-Matchcarries theETagof your read, as the read gave it, such as"12.4f1c09a2be57d3e8106fa9c4d2b0e771". The tag names the revision and its record. So a tag from before a restore is refused, also where the restore brings the same revision number back. A change written against a tag that no longer runs gets 409 and the current revision. Read again to get the new tag. A tag of a revision alone, as an older server gave it, gets 409 too, and so does a weak tag, because the server compares tags strongly. A list of tags matches where one of them does. AnIf-Matchthat is empty, or holds only commas and spaces, is a list of no tag. It matches nothing, and gets 409 too. A client that means to overwrite sends noIf-Match, or*without quotes.- The reads of the configuration carry the tag:
/api/serverand/api/node, as JSON and as text,/api/clientsand/api/zones/{id}. A row of/api/revisionscarries the tag of its revision intag. Reads of state that changes with no new revision, such as/api/health, the list of the zones and the blocklist sources, carry none. Idempotency-Keymakes a retry safe. The key is hashed with the change, so one key cannot answer for a change it was never sent with. Without the header, a bare retry against an unmoved revision is still one command.- A failure is a problem document, as
application/problem+json(RFC 9457). A failure about a setting names the file, the setting and the line. - Every change is a revision.
GET /api/revisionssays what was applied, what was refused and why, and which account asked. The row withrunningset totrueis the revision that runs. A row withrestorableset totrueis one that a rollback can reach now: its configuration is still kept on disk, it does not run, and it was not refused. A rollback to a row that saysfailedis refused with “revision N failed, so a rollback cannot reach it”. The server keeps the 10 configurations before the one that runs. The list comes one page at a time, newest first: 200 rows by default, andlimittakes 1 to 1000. To read an older page, send the smallestrevisionof a page asbefore. An empty page is the end of the history. Each row names what it changed inchanged. It lists each file, withadded,replacedorremoved, and the settings of a settings file, such aszones.retry, by name and with no value. An empty list of settings means that only comments or the layout changed. A refused change names what it tried to change.changedis absent in three cases: for a row recorded by a version before 10.04, for a change refused before it built a set of files (such as a staleIf-Match), and where the server could not record it, which it logs as a warning. A row names at most 64 files and 32 settings of each, andmoreandmore_settingscount the rest. A setting whose name is longer than 256 bytes is counted and not named. - A change that writes what is already there is not a change. The answer names the
revision that already holds it, and no new revision is made. That covers a
PUTand aPATCHsent without an idempotency key, andtadoru config apply. A rollback always makes a revision, and a request with a key is answered by that key.