Reverse lookup of Pihole system wrong - how to change it?

Hi Community,

I have installed two identical Pihole Systems, but one sends the wrong hostname when I reverse lookup it.

Affected System (should send "dns1.domain.local"):

➜  ~ nslookup 192.168.5.101            
Server:         192.168.5.101
Address:        192.168.5.101#53

101.5.168.192.in-addr.arpa      name = pi.hole.

If I ask my upstream DNS (INET Router) directly:

➜  ~ nslookup 192.168.5.101 192.168.5.1
Server:         192.168.5.1
Address:        192.168.5.1#53

101.5.168.192.in-addr.arpa      name = dns1.domain.local.

The working one:

➜  ~ nslookup 192.168.5.102            
Server:         192.168.5.101
Address:        192.168.5.101#53

102.5.168.192.in-addr.arpa      name = dns2.domain.local.

➜  ~ nslookup 192.168.5.102 192.168.5.1
Server:         192.168.5.1
Address:        192.168.5.1#53

102.5.168.192.in-addr.arpa      name = dns2.domain.local.

The Hostname / DNS / Network settings are correct and identical.

/etc/hosts:

127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

127.0.1.1       dns1
192.168.5.101   dns1.domain.local

I maybe changed the hostname after the PiHole installation (a long time ago) on my first installed PiHole, that's maybe the issue.

Any ideas how I can change it to the correct name? Is this maybe configured in a config of PiHole?

Thanks!

System: RPi 4b

  • **Pi-hole [v5.8.1]
  • FTL [v5.13]
  • Web Interface [v5.10.1]

Only if you configure Pi-hole to do so.

Hi @jfb
thanks for the docs article.

I have now checked all my configs bug cannot see any special setting that my affected PiHole should answer with "pi.hole" or on the correct one any setting that it should answer with the "hostname" (or FQDN). It is not clear for me why the first one is answering as "pi.hole" and the other not.

Can I fix it with the following setting? Or missed I anything?
PIHOLE_PTR=HOSTNAMEFQDN

Thanks!

Pi-hole is answering with the default.

Valid options are:

  • PI.HOLE (the default) respond with pi.hole
  • HOSTNAME serve the machine's global hostname
  • HOSTNAMEFQDN serve the machine's global hostname as fully qualified domain by adding the local suffix. See note below.
  • NONE Pi-hole will not respond automatically on PTR requests to local interface addresses. Ensure pi.hole and/or hostname records exist elsewhere.

Yes.

Works for me (added HOSTNAMEFQDN and generated dnsmasq conf for the local domain)
Thanks @jfb !

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