I use my DD-WRT router as DHCP and DnsMasq server - for many (valid) reasons...and most clients on the LAN just accept the automatic settings (meaning their DNS setting is the router). Yes, I understand that means that when a request gets to pi-hole it is seen as coming from the router... not the originating client.... I also have read 100's of posts about this.... Most of them just say - "you should change it so pi-hole runs the dhcp and dnsmasq for the local LAN" - which is avoiding the actual issue with a workaround. That workaround will be suitable for some, but not for many..
There seems to be a another potential approach to build a real solution for this.... I am going to say "MAC Address" but before you roll your eyes and shout me down with the standard arguments... just listen... this is a little bit different:
I run DNSMasq on my router and it does great job - even making local devices that are not static automatically addressable by name ..... AND there is an optional config setting:
Add Requestor MAC to DNS Query adds the internal requestor's MAC address to the query sent to the upstream DNS server, which could be necessary if the upstream server filters requests by MAC.
Currently that setting is being ignored by (upstream DNS) pi-hole. I have enabled it. It means that pi-hole is getting details of the originating device.... Surely that setting - if used - could be read by pi-hole to discern the downstream originating clients ?
IF it is already implemented, and I am using that setting "add-mac" , then why are the downstream clients (ie the LAN devices ) not showing in PI-Hole, but rather just the router shows as the pi-hole client with 99% of the acitivity... ?
and BTW ... WOW !! your response time on that post was AMAZING ! It was like sub-second !
For name resolution at the dashboard Pi-hole needs to know the IP of the clients, not the MAC.
You (also) need to add
--add-subnet=32 to your dnsmsq config (and 128 for IPv6)
In Tools -> Network you should than start seeing the individual client IP's.
In order to obtain the host names you have two ways: configure conditional forwarding for the relevant subnet to your router (which can provide hostnames it knows about via DHCP) or your configure them individually via Local DNS records.
ok - I do not use IPv6 so I will add "add-mask=32" to the DNSMasq settings on my router. Why 32 , that seems strange ? I mean as subnet mask it would be 24... But, whatever, I will add it like that =32.
There are no other subnets. I mean the pi-hole and the router are on the same subnet and that is the only subnet. On that subnet - the DNS ( in the router ) knows about all hostnames including the ones that are not static IP addresses... When you write "configure them individually via Local DNS records"... they (hostnames) are all in the local DNS at this time (running on the router).
Because this will add the exact IP of the client making the request. If you only add /24 dnsmasq will only add the /24 subnet to the request, making it impossible to identify the specific client.
That makes it easier I did not know how complicated your network is. In this case you can use the Pi-hole GUI to configure conditional forwarding to your router.
As soon as I added "add-mask=32" (I also tried 24) ... all name resolving stopped on my network. Meaning it could not resolve local name nor internet names.. I have taken "add-mask" out again.
I added it on my router ( which is running dnsmasq for the LAN ) ... or did you mean I should add that into the settings in the pi-hole ?
Does dnsmasq at the router stop or is it a problem with Pi-hole receiving the new queries? What version is of dnsmasq is your router running? The option was added in version 2.67.
This from the syslog of the router... so it is definitely sending MAC and hostname on to pi-hole.
Jun 24 10:25:31 nighthawk daemon.info dnsmasq-dhcp[13181]: DHCPREQUEST(br0) 192.168.9.142 4e:77:eb:1e:fc:ae
Jun 24 10:25:31 nighthawk daemon.info dnsmasq-dhcp[13181]: DHCPACK(br0) 192.168.9.142 4e:77:eb:1e:fc:ae SJSiPho11ProMax
I am trying to check the version of dnsmasq on the router.... But the add-mask was not ignored, it did do something, when I added it . I mean it stopped all names from being resolved for devices on the LAN....
I am pretty sure that DNSmasq in the router did not stop. But I do not know what else happened.... When I added the add-sub option, I then restarted DNSmasq on the router... it gave no errors, seemed to restart like every other time, so I assume it was running.