The classic DNS deployment lists every authoritative server as an NS record. The hidden-primary (or “stealth primary”) pattern departs from that — the primary is not in the NS set, only the secondaries are. This article explains why that asymmetry is the right default for production: security, change control, scaling, and how the NOTIFY + IXFR plumbing keeps the secondaries in sync.
How to verify
Before changing topology, see what the world sees. The published NS set is what resolvers use; the hidden primary is invisible to them by design:
dig example.com NS +short # what is published
dig +nssearch example.com # contact each NS for the SOA
dig @primary-internal.example.com example.com SOA +nsid
host -t SOA example.com
If the primary’s NSID or hostname does not appear in dig example.com NS, it is hidden — exactly the goal.
What’s happening
A “primary” is the authoritative source of a zone — the box where edits happen, where DNSSEC signing runs, where IXFR journals are kept. A “secondary” is a replica that pulls AXFR/IXFR from the primary and serves the same data.
In the published NS set, you list the servers resolvers should query. The published set has two requirements:
- Be reachable. Resolvers will contact each NS in the set; unreachable NSes cost latency on every cold lookup.
- Be answerable. Each must hold the zone data, signed, ready to answer.
There is no requirement that the primary be in the NS set. Hidden primary takes advantage of that:
- The primary lives in a controlled network (internal, VPN, restricted ingress).
- All NS records point at secondaries (public, edge, anycast).
- Edits, signing, and zone management happen on the primary.
- Changes propagate to secondaries via NOTIFY + IXFR.
Why this pattern wins
Security. The primary holds the signing keys and the source-of-truth zone files. It does not need to accept queries from the internet — only NOTIFY from itself and AXFR/IXFR requests from a finite, known list of secondaries. That is a much smaller attack surface.
Change control. Edits land at one place. The primary’s zone history (git, journal, audit log) is the canonical record. Secondaries are projections — losing one secondary loses no data.
Scaling. Adding capacity means provisioning a new secondary and pointing it at the primary. No need to coordinate updates to the published NS set unless you want the new node to be authoritative-visible.
DNSSEC ergonomics. Signing on the primary, then shipping the signed zone via AXFR, keeps key material on one host. Secondaries serve pre-signed RRsets and never see the private key.
Edge anycast compatibility. Public secondaries can be anycast PoPs operated by a managed-DNS provider. The team retains source-of-truth control via the primary while the provider’s global edge does the answering.
The architecture
A typical hidden-primary topology:
[editor / CI pipeline]
|
v
[Hidden Primary] (10.0.5.10, internal)
| | |
NOTIFY + IXFR (TSIG-signed)
| | |
v v v
[Sec A] [Sec B] [Sec C] (203.0.113.x, public)
| | |
public NS records point here
The hidden primary publishes nothing to the world. The secondaries are listed in the zone NS records and at the registrar (parent’s delegation).
The procedure (overview)
The implementation depends on the chosen authoritative software — see BIND9 primary/secondary transfers for concrete config. The pattern is:
-
Pick the primary’s network position. A jump-host in a controlled VLAN, behind a firewall that only permits TCP/UDP 53 from a known secondary IP set. Optionally a VPN-only address that resolvers cannot route to.
-
Generate TSIG keys for primary↔secondary authentication. See TSIG keys for secure transfer.
-
Configure the primary with
also-notifylisting every secondary,allow-transferrestricted to those secondaries, andnotify explicitso it does not NOTIFY the apex NS set (which does not include itself). -
Configure each secondary to AXFR/IXFR from the primary, signing with the shared TSIG key. Each secondary serves the zone normally; the public NS records point at the secondaries’ IPs.
-
Set the registrar delegation to point at the secondaries. The primary’s IP never appears.
-
Build a monitoring path that polls each secondary for the SOA and alerts on serial divergence. This is your replication health check.
Operational notes
- NOTIFY-on-zone-change is critical. Without NOTIFY, secondaries refresh on the SOA
refreshtimer (typically hours). Lost NOTIFY plus a hot change = stale secondaries. Confirm NOTIFY works after every topology change. - Hidden does not mean unreachable. If the primary cannot reach the secondaries (no outbound TCP/UDP 53 from the primary’s network), NOTIFY fails silently. Test outbound from the primary, not just inbound to the secondaries.
- DNSSEC signing on the primary. The primary holds the keys and signs the zone. Backups of the primary must include the key material (encrypted) and the KASP database. Losing keys without backup is a slow-rolling outage as RRSIGs expire.
- What if the primary dies? A hidden primary is not a single point of failure for queries — secondaries serve until SOA
expire. But edits are blocked. Practice the primary-restore drill, and consider a warm-standby primary in the same controlled network, ready to take over. - CDS/CDNSKEY at the primary. If you use modern signing automation, the primary publishes CDS/CDNSKEY for the registrar to scan. The secondaries serve them via the normal AXFR. The registrar scanning logic sees them at the published NS — which is the secondaries, exactly as intended.
- Visibility check the secondary doesn’t accidentally re-publish the primary’s IP. A misconfigured secondary that lists the primary as a peer NS leaks the address into AXFR responses. Audit the NS RRset on the secondary periodically.
In the engagements we run, the hidden-primary pattern is the default starting topology — it costs nothing to set up correctly from day one, and it makes every subsequent operation (DNSSEC rollover, secondary replacement, capacity expansion) easier. We codify the primary’s network posture, monitor the NOTIFY → IXFR chain end to end, and run a quarterly drill that confirms the primary-loss recovery still works. See our managed operations service for the broader operating model.