Lesson 4 of 9 · 24m
Zone Files, Delegation, and Glue Without Fear
Read a zone file like an operator: origin, owner names, SOA serial discipline, delegation NS records, and when glue is required.
A zone file looks archaic because DNS is old, but the structure is simple: owner name, TTL, class, type, data. The two things that burn people are name expansion and delegation. Both are invisible until a missing trailing dot or missing glue record makes half the internet unable to reach you.
Names are relative unless terminated
$ORIGIN sudosecurity.org.
$TTL 3600
@ IN SOA ns1.sudosecurity.org. hostmaster.sudosecurity.org. (
2026113001 7200 3600 1209600 300 )
@ IN NS ns1.sudosecurity.org.
@ IN NS ns2.sudosecurity.org.
@ IN A 203.0.113.10
mail IN A 203.0.113.25Because $ORIGIN is sudosecurity.org., owner www expands to www.sudosecurity.org.; @ means the origin itself. hostmaster.sudosecurity.org. encodes the mailbox hostmaster@sudosecurity.org. Write www.sudosecurity.org without the final dot and it expands to www.sudosecurity.org.sudosecurity.org. — a mistake every veteran has either made or cleaned up.
The SOA serial is operational machinery
Secondaries decide whether to transfer a zone by comparing serials. Use YYYYMMDDnn and increment it on every edit. If you forget, the primary may serve the new answer while secondaries never fetch it.
named-checkzone sudosecurity.org /etc/bind/zones/sudosecurity.org.zone
rndc reload sudosecurity.orgValidate before reload. A syntax typo can take down the whole zone even when the intended edit was one IP address.
Delegation is data in two places
ops IN NS ns1.ops.sudosecurity.org.
ops IN NS ns2.ops.sudosecurity.org.The parent publishes those NS records as a referral; the child zone also has NS records at its own apex. They should agree. Parent/child disagreement produces behavior that depends on which data a resolver cached first.
Glue breaks circular references
If a zone's nameservers are inside that same zone, the parent must publish their addresses as glue:
ops IN NS ns1.ops.sudosecurity.org.
ops IN NS ns2.ops.sudosecurity.org.
ns1.ops IN A 203.0.113.53
ns2.ops IN A 203.0.113.54Without glue resolution is circular: to reach ops, ask ns1.ops; to reach ns1.ops, ask ops. Registrar interfaces often call glue "registered nameservers" or "host records." Glue belongs at the parent, where bootstrap resolution can find it.
Delegation is trust
Delegating a subdomain to a SaaS or another team means trusting their operational and security posture below that point. If the service is decommissioned but delegation remains, an attacker who can claim the target may control the subdomain. Dangling delegations are takeover inventory.
Field notes
- Keep zone files in version control; the diff is your incident timeline.
named-checkzonecatches syntax, not intent. It happily accepts the wrong IP.- A zone cut is wherever NS records delegate control; records below it belong to the child zone.
- Never hand-edit one authoritative server without checking serial propagation to the others.
Was this lesson helpful?