Home lab secondary DNS: keep name resolution up when the first resolver goes down
What happens in your house when the one machine that answers DNS queries stops answering? If the lab has a single Pi-hole, the honest answer is that most of the internet stops with it, even though the connection itself is fine. Name resolution is the one service every other service quietly depends on, and a home lab usually gives it one container on one host. This guide builds the second resolver properly: two internal resolvers on different failure domains, one sync direction, a handout design chosen on purpose, and a test that proves failover instead of assuming it.
Why one resolver takes the whole house down
Pi-hole is often the first service a lab runs, and it becomes a single point of failure the day the router starts handing its address to every client. An update, a reboot, a full disk, or a crashed container on that one host leaves every device unable to resolve names. Pages fail to load, apps report no connection, and the fault looks like an internet outage. The fix is not a different product. The fix is a second resolver that returns the same answers, reached the same way, on hardware that does not share the first resolver fate.
One trap deserves naming early. Adding a public DNS server as the secondary entry does not create a standby. Clients do not all treat the first address as a strict primary and the second as a cold spare. Some rotate between the two, some race them, and some move after a timeout and stay moved for a while. A public secondary therefore answers real queries during normal operation, and those answers bypass local records and filtering policy entirely. Both advertised resolvers need to be yours, and both need to return compatible answers.
Two resolvers, placed on different failure domains
Redundancy is a placement decision before it is a software one. Two Pi-hole containers on the same hypervisor protect against a crashed process and nothing else. A host reboot, a failed switch, a tripped breaker, or a storage outage takes both. A practical small lab layout puts one resolver on the main server or NAS and the second on a low power physical machine, a small single board computer or an older mini PC, connected to the same core network and independent of the main virtualization cluster.
Give each resolver a static address, or a DHCP reservation that never changes. Clients will be told to use these addresses for years, through reboots and updates. If the lab runs VLANs, every VLAN that uses the resolvers must be able to reach both of them on port 53, and each VLAN DHCP scope must hand out both addresses. A second resolver that one VLAN cannot reach is a partial outage waiting for the wrong evening.
Which software runs on the pair is a smaller decision than where they sit. Pi-hole and AdGuard Home are the simpler filtering first choices, with blocklists and a friendly interface as the whole job. Technitium is the better fit when the lab also needs authoritative local zones, secondary zones, or conditional forwarding. Any of the three works in a pair. What none of them does automatically is agree with its partner, which is the subject of the sync section below.
Three ways to hand DNS to clients, compared
| Handout design | How clients reach a resolver | Failover behaviour | Pick it when |
|---|---|---|---|
| DHCP hands out both addresses | Each client holds both resolver addresses and uses its own resolver logic | Clients retry against the second address after a timeout; a small delay is normal, and clients do not automatically fail back | The default choice for most labs: no extra moving parts, works with any client |
| One virtual IP with keepalived | DHCP hands out one shared address that floats between the two nodes through VRRP | The surviving node takes the shared address over within seconds; clients notice nothing | Clients or gear handle a second DNS entry badly, or one address must never change |
| Public resolver as the second entry | Clients split queries between your resolver and a public service | No clean failover at all: the public service answers during normal operation too | Never, where local names or filtering matter; this is the trap design, listed so it can be recognised and removed |
The virtual IP design earns its extra complexity in one specific case: a device on the network handles multiple DNS entries so badly that one stable address is the only reliable option. For every other lab, handing out both addresses is simpler, and simpler wins for infrastructure you will debug at midnight. Either way, the pair behind the address or addresses must be kept in sync, because a client cannot tell which resolver answered it.
Keeping the pair in sync without drift
Two resolvers with different blocklists, allowlists, and local records produce a specific kind of confusion: the same name resolves two ways depending on which resolver a device happened to ask, and the fault moves when the device reboots. Sync removes that class of bug. Community sync tools such as Nebula Sync copy settings from one designated primary Pi-hole to the secondary on a schedule, so changes are made in one place only. The built in Teleporter backup covers the occasional manual copy for a lab that changes its lists rarely.
Three working rules keep drift from returning. First, pick one primary and edit only that one; a change made directly on the secondary is overwritten or, worse, half overwritten. Second, after any deliberate change on the primary, confirm the secondary shows the same blocklist count and the same local records before calling the change done. Third, keep the pair on the same software version where the sync tool expects matching versions, and update one at a time so DNS keeps serving during maintenance.
Pull the plug: the failover test, in order
A redundant design that has never been tested is a hope, not a design. Run this test once at build time and again after any network change.
- Record the normal state first. On a client, note both resolver addresses it holds and confirm a local lab name and a public name both resolve.
- Stop the primary resolver completely. Shut the machine or container down; pausing the service on a reachable host tests less than a full stop.
- Renew a client lease. Reconnect the client or renew its DHCP lease, so the client rebuilds its resolver state against the surviving resolver.
- Resolve both kinds of name. A public name proves upstream forwarding still works. A local lab name proves the secondary holds the local records, which is the part a public fallback would have failed.
- Check a second VLAN, if the lab has them. Repeat the two lookups from a client on another VLAN. Port 53 reachability is per network, and this is where a missing firewall allowance shows up.
- Bring the primary back and watch the logs. Queries logged on the secondary during the outage confirm clients actually failed over. An empty secondary log during a primary outage means clients went somewhere else, and finding out where is the real result of the test.
Success looks like this: with the primary off, a renewed client resolves a public name and a local lab name through the secondary, the secondary log shows the queries, and no device in the house reports an outage. Anything less names its own fix, a missing route, a stale local record, or a client holding a public resolver it should not have.
Which design fits your lab
Start with both addresses handed out by DHCP, the pair on separate hardware, and one directional sync. That covers the large majority of home labs, including the update and reboot cases that cause most real outages. Move to the virtual IP design only when a specific client or a specific piece of network gear proves it cannot handle two entries. Add monitoring last: a simple health check that alerts when either resolver stops answering turns the next failure into a notification instead of a household report, and it closes the design. Two resolvers, kept in sync, tested once with the plug pulled. Nobody in the house notices the next reboot.
, Dex Carter, Tech Writer