22.1. Planning Name and Address Services
A name and address plan answers three questions before any software is installed: who answers queries, who owns which addresses, and what happens when a piece of it breaks. This section fixes the vocabulary; the rest of the chapter configures software to match it.
22.1.1. Recursive Resolution, Authoritative Answers, and Delegation
Every DNS server in a network plays exactly one of two roles, and the chapter's design keeps them on different machines.
A recursive resolver does the walking on a client's behalf. Asked for a name it does not know, it queries the root servers, follows the referral to the TLD servers, follows the next referral to the zone's own servers, caches the answer for its TTL, and returns it. Clients point at a resolver and never query anything else. A validating resolver also checks every answer's DNSSEC signatures against a trust anchor before serving it.
An authoritative server answers only for zones it holds - and refuses everything else. It never walks the tree for anyone. Ask it about another zone and it answers REFUSED, exactly as the chapter's primary does in Section 22.3.
The two roles are connected by delegation: the parent zone lists the child's name servers (NS records) and their addresses (glue), so a resolver walking the tree gets handed from parent to child. Delegation is also where DNSSEC crosses zones - the parent publishes a DS record, a digest of the child's key, which lets a validator chain trust from the parent into the child (Section 22.4).
The practice network arranges both roles explicitly, and public names follow the ordinary path through the root:
Figure 22.2. Clients send every query to a validating resolver. Names in the local zones travel a forward zone to the authoritative servers; public names are resolved by full recursion through the root and TLD servers. The resolvers cache and validate; the authoritative servers only answer.
The demonstrations use dig throughout, pointed at specific servers
with @. Its useful options:
| Option | Description |
|---|---|
@server |
send the query to this address instead of the system resolver |
+short |
print only the answer data, one line per record |
+dnssec |
request DNSSEC records (sets the DO bit); includes RRSIG in answers |
-x address |
reverse the question: look up the PTR record for an address |
-b address |
bind the query's source address before sending |
+time=N, +tries=N |
wait N seconds per attempt, try N times - bounded diagnostics for unreachable servers |
-p port |
query a server listening on a nonstandard port |
On ns1, check the interface the plan assigned - as john:
$ ip -br addr show eth1
eth1 UP 192.168.232.10/24 fd22:232::10/64 fe80::5054:ff:fe78:e820/64
One interface, one IPv4 address, one IPv6 address - the plan in a
single line. The client-side checks from here on run dig, which a
default installation does not carry; install the query tools once,
as root on lanclient - and on relayclient, whose Section 22.5.4
checks use the same package:
# apt install bind9-dnsutils
apt prints its package plan and asks for confirmation; answer Y (or
just press Enter, since the default is to proceed). Every package
installation in this chapter behaves the same way.
Now compare the two roles from a client. On lanclient, as john, ask the authoritative primary directly for a local name:
$ dig @192.168.232.10 www.handbook.test A +short
192.168.232.10
The primary answered from its own zone. Ask the same server for a public name, and the roles separate:
$ dig @192.168.232.10 isc.org A | grep -E "status:|WARNING"
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 38686
;; WARNING: recursion requested but not available
dig asked for recursion (the rd flag it sets by default) and the
server refused - the WARNING line is dig observing that the
server will not recurse, and the status is the refusal itself. That
REFUSED is a design property, not a fault: an authoritative server
that answers only for its own zones cannot be used as an open proxy
for third-party queries, and its cache - it has none - cannot be
poisoned by strangers. Everything a client needs beyond
handbook.test comes from the resolvers of Section 22.2.
22.1.2. Address Pools, Reservations, Leases, and Local Names
DHCP inverts the static-address workflow: the server owns the address space, remembers what it handed out, and reclaims addresses whose clients stopped renewing. Three allocation methods cover a real network, and a plan states which client population uses which:
| Method | Address decided by | Best for |
|---|---|---|
| Static, configured on the host | the administrator, per host | servers, printers with panels, anything that must never move |
| Pool allocation | the server, first free address in the pool | ordinary clients that only need an address |
| Reservation | the server, a fixed address bound to the client's link address | infrastructure that wants DHCP's options but a predictable address |
A lease is the unit of that memory: the server records which
client (by link address) holds which IP, and for how long. The client
does not keep the address forever - it renews on a schedule the
server dictates with the lease, shown in Figure 22.3. Renewal at the
renew timer (T1) is a unicast to the server that granted the lease;
if that fails, rebind at rebind (T2) broadcasts to any server; if
nothing answers by expiry, the address is returned and the client
starts over. A client may also hand a lease back early with a
RELEASE.
Figure 22.3. The four-message exchange that grants a lease, and the timers that keep it. This chapter's Kea configuration uses a 300 s renew timer, 480 s rebind timer, and a 600 s valid lifetime - short enough that every failure mode in Section 22.8 appears within minutes.
The lease also carries the client's broader configuration: the default gateway, the resolver addresses, and the DNS search domain. Kea delivers these as numbered DHCP options - routers (3), domain-name-servers (6), domain-name (15) - and Section 22.5.2 shows them arriving on a real client.
Names follow the addressing plan. Every host that receives a lease
can also receive a name: the client sends its hostname, and the
update chain of Section 22.6.3 turns that hostname into A and PTR
records in the local zone, with the same lifetime semantics as the
lease behind them. Names that exist only inside one network and
should never leak into public DNS belong under home.arpa, the
special-use domain for residential and lab networks; Section 22.2.3
shows a resolver serving such names locally without any zone file at
all. Chapter 17 covers the client's
half of all this - /etc/hosts, the NSS lookup order, and how
/etc/resolv.conf gets written.
22.1.3. Service Placement, Client Discovery, and Failure Domains
Where the services run is a failure-domain decision before it is a performance one. The chapter's split - authoritative DNS on ns1/ns2, resolving on resolver/ns2, DHCP on ns1 with a standby on ns2 - means no single host failure removes both answering and resolving, an upgrade of BIND never interrupts a client's lease renewal, and the recursive load of a hundred clients never delays an authoritative answer. A smaller site can collapse the roles onto one or two machines; the constraint to keep is that recursive and authoritative services fail and restart independently, and that the failure of whichever host holds DHCP does not take the name service with it if leases are expected to outlive reboots.
Clients discover the servers through the services themselves, which is the point of the arrangement:
- IPv4 clients receive resolvers, gateway, and search domain in the lease (options 6, 3, 15). Before the first lease, a client reaches the DHCP server by broadcast alone - no address, no configuration, nothing to misconfigure.
- IPv6 clients receive the same information from router advertisements: the M and O flags steer them to DHCPv6, and the RDNSS/DNSSL options carry resolver addresses and the search domain. Section 22.7 configures the advertising router.
- The resolvers are published redundantly - two addresses in every IPv4 lease - because a lone resolver is the single most effective way to make an entire site feel offline while every server is running. The IPv6 side follows the same principle, and the practice network's single-address form there is a lab economy, flagged where it is configured.
The failure domains deserve counting. DNS failure is immediate and total for name-dependent work: if both resolvers are unreachable, new connections by name stop, though anything already resolved keeps working. DHCP failure is slower and partial: existing leases persist until their valid lifetime expires, and only clients that need a new lease - booting, roaming, or past expiry - notice. The practice network's short 600 s lifetime makes failure visible quickly; a production network picks lifetimes by how long clients should keep working through an outage, which is usually hours, not minutes. The relay is a third, easily forgotten domain: every client behind dhcprelay depends on it for both DHCP and the route back to the services, so it gets the same care as the servers (Section 22.5.4).