In this scenario we are configuring two Pi-holes running on the same network. pihole0
is the main DNS server while pihole1
is the secondary.
pihole0
192.168.1.4
http://pi.hole0/admin/
pihole1
192.168.1.5
http://pi.hole1/admin/
These IP addresses are examples, you should replace them with the static IP addresses of your devices.
There are two required steps and a third optional step:
- Edit
/etc/hostname
- Edit
/etc/hosts
- Add
pihole0
as a DNS server onpihole1
Pick one Pi-hole device to be the main DNS server, this will be pihole0
.
On the chosen pihole0
edit the contents of /etc/hostname
to read pihole0
. On the other Pi-hole device, pihole1
, edit /etc/hostname
to read pihole1
.
On pihole0
edit /etc/hosts
. The second line should read something like 127.0.1.1 $HOSTNAME
change this to read 192.168.1.4 pihole0
.
On pihole1
edit /etc/hosts
, change the second line to read 192.168.1.5 pihole1
.
Go to the admin web interface of pihole1
, http://pi.hole1/admin/
. In Settings
> DNS
> Upstream DNS Servers
> Add 192.168.1.4
(AKA pihole0
) as a custom entry.
The main DNS server pihole0
will resolve most of the queries on the network, pihole1
should get a comparatively small number of requests. As a result pihole0
will likely have the answers to many of the requests sent to pihole1
in its cache. dnsmasq
sends quries to all its configured upstream servers and uses the fastest response. If pihole0
has an answer in its cache it should be the fastest response as its on the local network. This allows us to take advantage of the larger cache maintained by pihole0
.