Pi-hole Failover With keepalived, and the Three Times It Failed Quietly

· Networking, Running the Lab

Nothing went wrong to make me build this. My background is in nuclear, where anything mission-critical gets redundancy, and in our house the internet is mission-critical. I work from home, my wife does some work from home too, and my son games a lot. Pi-hole answers every DNS lookup in the house, so if it fails quietly, the internet looks broken to all of us. I wasn’t willing to accept that, so from the start I wanted redundancy, automatic failover and alerts.

It didn’t arrive in one go. What runs now is the result of several rounds of “that works, but…”, and three failures that each taught me something. This is how it got here.

How it works now

Diagram: every device sends DNS lookups to one shared address. Normally Pi-hole 1 on the HP Omen answers; if it stops, Pi-hole 2 on the Acer small desktop takes over within seconds. Nebula Sync copies settings from Pi-hole 1 to Pi-hole 2 every 30 minutes.

Every device on the network sends its DNS lookups to one address. Two Pi-holes run keepalived, which uses VRRP (a standard protocol routers use to share an address) to decide which of them holds that address. The main Pi-hole runs in a small container on my Proxmox server, an old HP Omen desktop. The backup runs directly on an Acer Aspire XC-603G, a small desktop with an Intel Celeron J1900. Separate hardware is the point: if the server is down for an update, the Acer is still up.

keepalived on the main Pi-hole runs a health check every five seconds that tests whether Pi-hole itself answers. Two failures in a row and the backup takes the address, usually within a few seconds. Nothing on the devices changes. Both run Pi-hole v6, and the rest of the lab is in what runs in my homelab.

Where it started: Proxmox that wouldn’t install

My first machine was that Acer, and Pi-hole wasn’t the plan. I wanted Proxmox on it, mainly to run Home Assistant. Off and on for a couple of weeks I tried to install it and kept running into trouble. The J1900 is a Bay Trail chip from 2013–2014, and it doesn’t get along well with the system Proxmox is built on. I also tried the other route Proxmox documents, installing Debian 12 (“bookworm”) first and adding Proxmox on top, and even that barely worked.

The box still needs a workaround today: it runs plain Debian with a kernel setting that keeps the chip out of its deepest power-saving states, a common fix for Bay Trail machines that freeze.

So I scaled back and put Pi-hole on the Acer by itself. That worked well, and it became the first thing in my lab doing a real job, before Home Assistant.

A second machine from the closet

I still needed something to run Proxmox. I was thinking about buying another small PC when I remembered my son’s old gaming PC, an HP Omen, sitting in the closet doing nothing. Talking it through with Claude, it was clearly more than enough, and it cost nothing. Proxmox runs happily on it, and with Proxmox running, a second Pi-hole could go in a small container on it.

That second Pi-hole ended up as the main one. The Acer that started it all became the backup.

Foundation first

I did get Home Assistant installed around then, but I held back from building on it. I wanted the infrastructure solid before anything the house would come to rely on. Then I read a homelab hardening write-up on Reddit, and it moved security up my list too. Nothing in my lab is open to the internet, and I have no plans to open anything, but I wanted it done properly before it mattered. So infrastructure and hardening came first, and DNS redundancy was part of that foundation.

One address for two Pi-holes

Two Pi-holes aren’t redundancy if every device points at only one of them, or if they’re both handed out and the devices choose which to ask. So I set up keepalived on both, which gives them the one shared address described above. The Omen’s Pi-hole has the higher priority and normally holds it; the Acer takes over when the Omen’s copy stops answering.

Keeping the two in sync

Two Pi-holes only help if they block the same things and know the same local names. I started with Gravity Sync, the tool most guides used. But its author retired it in 2024 and it doesn’t work with Pi-hole v6, so when I moved to v6 I replaced it with Nebula Sync. It runs in Docker and copies the main Pi-hole’s whole setup to the backup every 30 minutes. Changes go one way only, so I make them on the main Pi-hole and let the copy follow.

Updates without dropping DNS

The next problem was my own update scripts. Updating the server that holds the main Pi-hole takes it down for a while, and I didn’t want DNS to depend on how quickly it came back. So before the scripts touch the main Pi-hole, they stop keepalived there, which hands the address to the Acer on purpose. The address only moves back after the scripts have checked that DNS works on the updated machine.

The updates also used to start at 3:00 in the morning, when the sync runs too. I moved them to 3:05 so the two don’t trip over each other.

Quiet failure 1: Pi-hole kept answering but stopped blocking

This was the worst one, because nothing looked wrong. Pi-hole applies its blocklists through groups, and every device on my network falls into the Default group. At some point the Default group was disabled. Pi-hole kept answering every lookup normally, so the internet worked and nothing alerted, but it blocked nothing. That lasted from April to late September 2026.

Failover didn’t help: the sync faithfully copied the disabled group to the backup within half an hour.

I found out by luck. I came across a Reddit thread about an ad test page that loads test ads to show whether your Pi-hole is blocking them. I tried it, and the ads loaded. Pi-hole was blocking nothing.

The fix was one switch. The lesson was that “DNS works” and “Pi-hole blocks” are two different checks. Now the check looks up a known ad domain and expects 0.0.0.0 back. It has to run from a device without its own ad blocker, because a browser blocker hides the problem.

Quiet failure 2: both Pi-holes held the address for 13 hours

In September 2026 I turned on a firewall on the Acer that blocked everything not explicitly allowed. VRRP isn’t TCP or UDP; it’s its own IP protocol, number 112, and allowing ports doesn’t cover it. The Acer stopped hearing the main Pi-hole’s announcements, decided it was gone, and took the address too. For at least 13 hours both machines claimed it.

If you run a firewall on a keepalived machine, allow VRRP (IP protocol 112) explicitly.

Afterwards I added a check that runs every minute and alerts my phone if more than one machine holds the address. In October I tested it by forcing the same split on purpose: the alert reached my phone in about four minutes, and the address went back to the main Pi-hole as soon as I removed the block.

Quiet failure 3: the sync stopped after a password change

In October I moved the Pi-holes to app passwords, which are API keys for tools like the sync. Late one evening I replaced the backup Pi-hole’s app password, and from 11 p.m. every sync failed with an authentication error. DNS kept working, so nobody noticed, but the backup was quietly falling behind the main one. Nothing was watching the sync.

Claude caught it the next morning while reading through the logs on its morning check. Putting the new password in should have been a two-minute fix, but my first test said “password incorrect”. The key I had pasted from Notepad carried an invisible carriage return at the end, so it was one character too long. Strip that, and it worked. The sync was back by 12:35 the next day, after about 13 hours of failed runs.

First Claude’s morning check started reading the sync log every day. Then I went further: now the sync reports its own result, so a failed sync raises an alert on my phone within minutes, and a separate check alerts if the sync stops running at all.

Where it is now

On 1 November I put a firewall in front of the main Pi-hole too. This time VRRP from the Acer was on the allowed list from the start, so the September lesson stuck.

What watches it now: the health check that moves the address within seconds, a check that alerts my phone if both machines hold the address, a blocking check that expects 0.0.0.0 for an ad domain, and alerts if the sync fails or stops running. Each of those exists because something failed quietly first.

Would I do it again?

Yes, if your Pi-hole is your network’s DNS server. That’s the important part. If every device in the house asks Pi-hole for every address, a single Pi-hole is a single point of failure for the whole internet, and a second one is the only way not to lose it when the first goes down.

Some people avoid that by giving their devices a public DNS server as a backup instead. That keeps the internet up, but devices can use the backup whenever they like, not only when Pi-hole is down, so ads slip through. A second Pi-hole is the way to keep both.