High availability (HA) for Pi-hole (running two Pi-hole's)

Hi All-
I'd suggest renaming this feature to something like, "Sync Settings Between 2 or More Pi-hole instances."

It occurs to me that trying to load-balance or round-robin through a proxy IP creates a new single point of failure (e.g., the load-balancer crashes, and host are only configured with the IP of the load-balancer).

Most (if not all) routers are able to configure DHCP clients with 2 or more DNS servers. It seems more attainable for the noob to buy 2 Rpi's. Run the installer on the first Rpi and configure their preferred settings, then run the installer on a second device and choose an option to, "Configure this Pihole as a backup to existing Pihole."

The second PiHole would need remote access to the first Pihole, and a script to periodically check for changes to certain configuration files or settings; and if-changed, import those settings.

Considerations would need to be made if RP1 is configured as a DHCP server (i.e, to avoid having 2 active DHCP servers). The RPi2 would need to "survive on its own" if RPi1 goes down (i.e., RPi2 should perform its own gravity updates and not rely on RPi1 syncing). The user interface should indicate the last time RPi2 has completed a sync, and a warning or error should be visible if RPi1 is not accessible by RPi2.

I am going to try to adapt the script identified above for my scenario. I think it captures most of the basic settings files, but I need it to also sync my 02-pihole.conf in /etc/dnsmasq.d for conditional forwarding (More than one "Conditional Forwarding" entry in the GUI - #5 by sbellon).

Cheers!

3 Likes