Automatic DHCP Switching between 2 pi-holes

Hello all

I currently run a pi-hole setup with 2 raspis that provide dns from different upstream servers.
Raspi1 -> 192.168.1.10
Raspi2 -> 192.168.1.11

Raspi1 is also the DHCP-Server for the subnet.
Raspi2 is using conditional forwarding to get the Names of local clients from Raspi1.

Recently Raspi1 wouldn't respond to DNS Queries or DHCP Request and I had to enable the DHCP on Raspi2.
Now I would like to have some sort of Script or similar, which switches the DHCP-Server from Raspi1 to Raspi2 and also back to Raspi1 in a Weekly cycle. Can this be done via a shell script which gets executed via cronjob and which Settings do I need to change in the config files?

You could simply enable Pi-hole's DHCP server on the second RPi as well.

In order to avoid IP address conflicts, you should use distinct, separate IP ranges on both Pi-holes, e.g. .100 through .149 on RPi-1 and .150 through .199 on RPi-2.

For static DHCP leases, you could still have the same configuration on both Pi-holes. As chances are that is mostly a one-time effort (when a new device needs a fixed IP address DHCP lease), there would be no immediate need for scripts if you wouldn't mind doing this manually.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.