Sub topic 3
Zones and delegation
This chapter assumes you know the domain name hierarchy (labels, root, TLDs) and what an NS record is. It explains how that hierarchy is split into pieces that different parties manage.
Zones are not domains
A domain is a subtree of the namespace. example.com and everything beneath it is one domain. A zone is the part of that tree managed as one unit, stored as one set of records on one set of authoritative servers.
A zone can be smaller than its domain. If example.com hands dev.example.com to another team, the example.com zone no longer contains anything under dev. The domain still includes those names, but they live in a separate zone.
Delegation
Delegation is how a zone passes responsibility for a subtree to another zone. The parent zone does this with NS records that name the child's servers. After that, the parent only knows who is in charge of the child, not what the child contains.
$ORIGIN example.com.
$TTL 3600
dev IN NS ns1.dev.example.com.
IN NS ns.example.net.
ns1.dev IN A 198.51.100.53These lines belong in the example.com zone file. The first NS record names a server inside the delegated zone, so the parent must also publish an A record for it. That record is called glue. Without glue, a resolver would need the address of ns1.dev.example.com to look up dev.example.com, and it could only get that address by looking up dev.example.com. The second NS record names a server in another domain, so it needs no glue.
Seeing a delegation
A parent server answers a question about a child with a referral instead of a final answer. You can ask a com server about example.com and see one:
dig +norecurse @a.gtld-servers.net example.com NSThe NS records come back in the AUTHORITY section, not the ANSWER section. Any glue addresses appear in the ADDITIONAL section. The aa flag is absent, because the com server is not authoritative for example.com.
Two sets of NS records
The delegation NS records in the parent and the apex NS records in the child's own zone are separate data. The child's servers are the authority on what they hold. Resolvers still reach the child through the parent's records first.
Keep the two sets in agreement. Common errors:
- Lame delegation: the parent lists a server that does not answer authoritatively for the zone. Some queries fail or time out, depending on which server a resolver picks.
- Missing glue: the NS names sit inside the delegated zone, but the parent has no address for them. The zone becomes unreachable.
- Stale glue: a name server moves to a new IP address and the parent's glue still holds the old one. This is a frequent cause of partial outages.
- Stranded records: records for
dev.example.comremain in the parent zone after delegation. Resolvers following the referral never see them.
Exercise
The example.com zone delegates sales.example.com to the name server ns.sales.example.com. What extra record must the example.com zone contain, and why?
Show answer
An A record (glue) for ns.sales.example.com. The name server's name is inside the zone it serves, so a resolver cannot look it up without already knowing the server's address. The parent supplies that address.