Zones, delegation and the namespace tree
Domains vs zones
The DNS namespace is a tree: root (.) → TLDs (com, in, org) → second-level domains (example.com) → subdomains. A domain is a subtree of names. A zone is the part of the tree managed as one administrative unit by one set of authoritative servers.
example.com and dev.example.com are in the same zone unless dev.example.com is delegated with NS records — then it's a separate zone with its own servers, SOA and NS. Not every subdomain is a zone.
How delegation works
A parent zone delegates a child by publishing NS records for the child's name pointing at the child's authoritative servers:
; in the .com zone (run by Verisign)
example.com. 172800 IN NS ns-1234.awsdns-12.org.
example.com. 172800 IN NS ns-567.awsdns-07.net.
example.com. 172800 IN NS ns-89.awsdns-11.com.
example.com. 172800 IN NS ns-2001.awsdns-50.co.uk.
When a resolver asks the .com servers about api.example.com, they don't know the answer; they return a referral: "ask these name servers". The resolver follows it.
The delegation chain for api.example.com:
- Resolver asks a root server → referral to the
.comTLD servers. - Asks a
.comserver → referral toexample.com's authoritative servers (NS + glue if needed). - Asks an
example.comauthoritative server → the A record forapi(withaa). - Caches everything along the way (NS records, addresses) for their TTLs.
dig +trace api.example.com shows these steps yourself.
NS records live in two places
- At the parent (the delegation, published by the TLD from what your registrar sends).
- At the child (the zone's own apex NS records, authoritative).
They should match. When they don't, behaviour depends on which a resolver happened to cache. The parent's records are what the world uses to find you — if your registrar still lists the old provider's servers, your shiny new Route 53 zone is simply ignored.
Glue records
If a zone's name servers are named inside the zone they serve — example.com served by ns1.example.com — there's a circular dependency: to find ns1.example.com you need to ask example.com's name servers, which are ns1.example.com. The parent breaks the loop by publishing glue: A/AAAA records for those name servers, included in the referral's additional section.
; in the .com zone
example.com. IN NS ns1.example.com.
ns1.example.com. IN A 198.51.100.53 ; glue
Glue is only needed for in-bailiwick name servers. Route 53's name servers (*.awsdns-*.com/net/org/co.uk) are in other domains, so you never need glue for Route 53-hosted zones. If you run your own ns1.example.com and the glue is missing at the registrar, resolution fails or is flaky.
Lame delegation
A lame delegation happens when an NS record points at a server that doesn't actually serve the zone authoritatively — a decommissioned server, a deleted hosted zone, a typo. Resolvers that pick that server get REFUSED/SERVFAIL or time out, then try others; users see intermittent slowness or SERVFAIL.
The registrar's role
You register a domain through a registrar (Route 53 Domains, GoDaddy, Namecheap, BigRock for .in). The registrar submits your name servers (and glue, DS records for DNSSEC) to the registry that runs the TLD. The registrar and the DNS host can be different companies: domain registered at GoDaddy, DNS hosted in Route 53 — then you change NS at GoDaddy.