Load balancing/syncing or redundancy between 2 Pi-holes?


I'm using two different VMs with one Pi-hole instance running on each. The reason was primarily to have a backup if I need to shutdown/reboot one of them, and it works nicely. I have both VMs' IPs entered in my Fritzbox Internet > Zugansdaten > DNS-Server settings (one primary, the other as alternative).

Queries seem to be distributed between both Pi-holes arbitrarily. Are they? I don't know if there is a rule or something else triggering, which Pi-hole is asked. At the moment, there are more queries on the second (alternative) one.

Now I wonder if this setup is really good, because when I change something, e.g. adding domains to the lists of one Pi-hole, I have to repeat that on the other. I could use the teleporter for this, but it is still manual work.

Could there be some synchronisation of lists? Also for other settings as clients and groups? Would this lead to some kind of "load-balancing"? I don't focus on load but rather on redundancy/backup.

Or is my thinking overall into the wrong direction and does not make sense at all? :wink:

Thanks for sharing your thoughts! :slight_smile:

Gravity-sync? GitHub - vmstan/gravity-sync: 💫 The easy way to synchronize the DNS configuration of two Pi-hole 5.x instances.

1 Like

Not sure if you are setting the DNS in your Fritzbox in the WAN section but this usually is set in the DHCP DNS, so clients will get both DNS while getting the ip address and not all DNS queries going through the router and then to the pihole....
On the other side, yes this will not be balanced as is working as intended. Clients will query any of the configured DNS, but normally hitting more queries in the primary (although you are saying that your secondary is getting much)
You can sync piholes using gravity , setup this as High Availability i.e. with keepalived (google for more info....so only 1 pihole would be active at the time) or simply leave the 2 piholes set in your DHCP DNS configuration.

1 Like

Thank you both! I took out the second (alternative) Pi-hole from my Fritzbox settings and will only enter it when I know that I have to shutdown the primary Pi-hole VM. But it's good to know that there's a way of synching. :slight_smile:

PS: Gravity-sync works great! :+1: Thanks a lot @vmstan ! :heart:

This topic was automatically closed after 3 days. New replies are no longer allowed.