← All posts

Why I use a hidden DNS master

DNS is involved before someone can reach most of the services I run. Their resolver needs to find the right address, whether they are opening the blog or sending me email. Taking control of those records is useful, but it also puts an important part of access to those services in my hands.

A hidden-primary setup lets me maintain the records myself while using separate servers to answer public queries. In Zebra, my Kubernetes cluster, PowerDNS Authoritative holds the primary zones and ClouDNS provides the public secondaries.

My changes -> home primary -> zone transfer -> public secondaries
                                                    ^
                                                    |
                                             public DNS queries

Clients normally ask the secondaries. The primary still holds sensitive management state and signing material.

How a change reaches the internet

I change a record on the primary. The secondaries obtain updated zone data through DNS transfers and serve their copies to the public. A zone is the set of DNS records managed together for a domain. The domain's delegation names the servers responsible for answering those queries; here it points at the public secondaries rather than the primary.

This separates the place where I manage a zone from the places answering queries. If the primary becomes unavailable, the secondaries can continue serving their existing copies for a time. That is useful when maintenance or a failure interrupts the primary without requiring every public query to fail with it.

The transfer path still needs protection. My configuration restricts it by source IP; it does not currently authenticate transfers with TSIG, a shared-key mechanism for authenticating DNS messages. Management has a separate private access path. The word "hidden" describes the primary's role in delegation, not a guarantee that nobody can reach it.

What I gain, and what remains outside

The benefit is control over the source of my DNS records and the tools that manage them, while public answering is spread across the secondary provider's servers.

I still depend on that provider, deliberately. DNS is too important to answer only from my machines, and I can't defend the home connection against a large denial-of-service attack. I don't like handing control of all my DNS to a platform such as Cloudflare either. Keeping the primary while renting public answering is my compromise, not a guarantee against every attack.

I'd add a primary if you want control of zone management, integration with your own tools, or a reason to learn how authoritative DNS works. It's quite a bit to look after if all you need is the occasional address change. That's the maintenance-versus-control decision I try to make before adding another service.

Looking after the copies

Secondaries cannot serve an unreachable primary's data forever. Zone expiry limits how long they can continue without refreshing. DNSSEC adds signatures that let resolvers check the authenticity of DNS data. Those signatures also expire, potentially causing validating resolvers to reject answers sooner.

I therefore need to know whether the copies remain current and valid. My monitoring compares the version numbers in SOA (Start of Authority) records and checks their signatures on the secondaries, alongside separate validating-resolver probes. These checks have limits: inspecting the SOA signature does not validate every record in a zone.

The primary's records and signing keys live in PostgreSQL. Rebuilding its container would not recover that state. Backups must include the database and sensitive signing material, with recovery possible outside the failed cluster. That connects DNS to the wider backup strategy, including the need to recover keys independently.

A compromised DNS-management account is a different failure from an unreachable primary: it can distribute unwanted records to healthy secondaries. Access controls, change review, and recovery of a known-good zone matter alongside freshness checks. Transfer authentication remains a gap in this design, and restoring the primary after room-wide data loss still needs its database and keys. DNSSEC does not prevent an authorised management path from signing an unwanted change.

I like being able to manage the source of my own DNS records while the secondaries handle public queries. If that appeals to you too, pay attention to how long those copies stay valid and how you'll recover the primary. For the occasional DNS edit, a managed provider is a lot less work. I wouldn't add this just to avoid clicking their dashboard.

← Back to the notebook