Can't get Reverse Lookups to work (Top Clients shows IP addresses only)

I've been struggling with this for a while and I'm going around in circles it seems!

So - the setup is:

clients -> pihole -> router (DHCP) -> modem -> internet
192.168.1.x

I have the pihole sending requests to the router (which is DHCP) and an internal other DNS server (Domain Controller). The DHCP/Router is listed first in the DNS settings of the pihole.

I've disabled both of the pihole settings to do with reverse look ups:
never forward non-FQDNs
never forward reverse lookups for private IP ranges

When I do a reverse lookup of an IP directly using nslookup against the router, it gives me an address:

[root@pihole log]# nslookup
> server 192.168.1.1
Default server: 192.168.1.1
Address: 192.168.1.1#53
> 192.168.1.157
Server:         192.168.1.1
Address:        192.168.1.1#53

157.1.168.192.in-addr.arpa      name = amazon-1b9d96726.local.domainname.tld.

However, when I do this to the pihole, I don't get a response:

 [root@pihole log]# nslookup
> 192.168.1.157
Server:         192.168.1.8
Address:        192.168.1.8#53

** server can't find 157.1.168.192.in-addr.arpa.: NXDOMAIN

BUT this is showing the secondary dns server, not the router, wtf.

So, I tried adding a 10-lan-domain.conf:

[root@pihole dnsmasq.d]# cat 10-lan-domain.conf
server=/local.domainname.tld/192.168.1.1
server=/1.168.192.in-addr.arpa/192.168.1.1
[root@pihole dnsmasq.d]#

but still no dice.

I've tried removing all of the pihole log files, and the FTL database, and restarting FTL, but you see the FTL log show clients appearing without name resolution.

For various reasons, I don't want the Pihole to be the DHCP server.

Debug log; licipjl8zs

Ok, so I got the reverse lookup to work, but now have lost all ability to resolve internal addresses, whoops!

Changing the /etc/resolv.conf (via /etc/sysconfig/network-scripts/ifcfg-eth0) to add the other DNS server has fixed that for me.

So, to recap what I need:

  • Reverse Requests should always go to the DHCP router
  • requests for my local domain should all go to the domain controller
  • Requests for anything else can go to either of the DNS server (Router or domain controller)

I thought that DNS tried a second server if it got a NXDOMAIN response, but it doesn't appear to be working for me :frowning:

Ok, fixed!

So, I added a new 10-lan-domain.conf to the /etc/dnsmasq.d/ directory that had:

[root@pihole dnsmasq.d]# cat /etc/dnsmasq.d/10-lan-domain.conf
server=/local.domainname.tld/192.168.1.8
server=/1.168.192.in-addr.arpa/192.168.1.1

This allows for reverse lookups to go one place and DNS lookups for local domain to go another.

Yay!

That solution looks very similar to this PR:
https://github.com/pi-hole/AdminLTE/pull/653