Local DNS records & dns.piholePTR when you have two Pi-holes

I am setting up a second Pi-hole to act as a backup. When I just had one, the admin panel was accessed at HTTP://pi.hole:8989/admin

When I add a second pi, how do I set up the local DNS records and/or the dns.piholePTR setting so that they have separate addresses?

I have .lan set up as a local domain, so ideally i'd like them to resolve as pi.hole.lan and pi.hole2.lan

What is the best way to set these up, especially with regard to the dns.piholePTR setting.

Thanks!

I dont address them by the pi.hole name thats baked into every Pi-hole install OOTB.
I address them by their hostname:

$ hostname
ph6a
$ hostname -f
ph6a.home.dehakkelaar.nl

Eg from a client with my two Pi-hole nodes 10.0.0.2=ph6a & 10.0.0.5=ph6b:

$ dig +short @10.0.0.2 ph6a.home.dehakkelaar.nl
10.0.0.2
$ dig +short @10.0.0.2 ph6b.home.dehakkelaar.nl
10.0.0.5
$ dig +short @10.0.0.5 ph6a.home.dehakkelaar.nl
10.0.0.2
$ dig +short @10.0.0.5 ph6b.home.dehakkelaar.nl
10.0.0.5

For that I created a "Local DNS Record" via the webGUI on each of the nodes pointing to the other eg on node a:

$ sudo pihole-FTL --config dns.hosts
[ 10.0.0.5 ph6b.home.dehakkelaar.nl ]

If you want the PTR record to return the hostname instead of pi.hole:

$ dig +short @10.0.0.2 -x 10.0.0.2
pi.hole.

On the Pi-hole host (can also be done via the webGUI DNS settings):

$ sudo pihole-FTL --config dns.piholePTR 'HOSTNAMEFQDN'
HOSTNAMEFQDN

On client again:

$ dig +short @10.0.0.2 -x 10.0.0.2
ph6a.home.dehakkelaar.nl.

Check that setting on the webGUI for what options you have!
And oc I dont address them by their FQDN ... most of the times :wink:

$ nslookup ph6a
Server:         10.0.0.2
Address:        10.0.0.2#53

Name:   ph6a.home.dehakkelaar.nl
Address: 10.0.0.2
$ nslookup 10.0.0.2
2.0.0.10.in-addr.arpa   name = ph6a.home.dehakkelaar.nl.

Or:

http://ph6a/admin
https://ph6a/admin

You can also change the Pi-hole option webserver.domain to something different than pi.hole in Settings > All Settings page, Webserver and API tab:

2 Likes

Perfect Thank you!