Group Management known client lists - wrong hostname

Problem with Beta 5.0:
In the Group Management -> Clients -> Known clients list, it lists clients on the network but some of the hostnames are incorrect. Most of my clients have either a static IP or a DHCP reservation but some (but not all) of the hostnames are incorrect (note my Pi-Hole is not the DHCP server plus it's configured to do conditional forwarding to the main DNS which is authoritative for hosts on the LAN).

I've tried flushing the ARP cache on the Pi as well as deleting the network list from Pi-Hole with: sudo sqlite3 /etc/pihole/pihole-FTL.db "DELETE FROM network" but when it repopulates many of the hostnames are still incorrect.

Welcome to the Pi-hole community, powloo. :slight_smile:

An IP within your network might well be associated with several hostnames, including the one a device assigns for itself.

Wrong -or rather: unexpected- hostnames for local devices could thus appear in Pi-hole if a device indeed has multiple hostnames assigned.

Try a reverse lookup for the IP address of such a wrong name to confirm that this is the case for you, i.e. dig +short -x <ip.ad.dr.re.ss>.

There is no way to enforce preferred usage of a certain hostname only.
If you're lucky, you may be able to control behaviour and/or sort order of hostnames on your main DNS, depending on the software.

Alternatively, you could manually provide hostnames in Pi-hole's /etc/hosts, which will take precedence over other names.
Upcoming Pi-hole v5 will provide an alternative and more convenient way to provide hostnames via its admin UI under Custom DNS, though I am not entirely sure how that would behave in this regard when working with a separate authoritative DNS in your local network.

Hi Bucking_Horn,

Thanks for the reply. Unfortunately, my devices don't have multiple host names. Any device with a DHCP reservation has a corresponding unique hostname configured on my DHCP/DNS server.

I would agree that if a device has multiple hostnames associated with it that might happen, but that's not the case here. The hostnames appearing in the list against some of my devices have nothing to do with that IP address (e.g. the hostname of my laptop is appearing against the IP address of my wifi AP). In many circumstances, there is absolutely no correlation between the IP and the hostname.

I'll have a look at the code to see how this list is being populated and update here if I can get to the bottom of it.

Could you provide a screen shot of such an offense in a Query Log, along with the (textual) result of corresponding

dig +short -x <client-ip> @<Pi-hole-IP>
dig +short -x <client-ip> @<Main-DNS-IP>

Will do. I emptied the 'network' and 'network_addresses' table and let the system repopulate. As of right now, all the IPs and hostnames are correct. I'm keeping an eye on it and when it happens again, I'll update this thread with the details.

@powloo

I've got the same problem you had - ie, hostnames that ave nothing to do with the stated IP address.

How did you empty the ‘network’ and ‘network_addresses’ tables?

Hi, using sqlite3:

sudo sqlite3 /etc/pihole/pihole-FTL.db "DELETE FROM network"
sudo sqlite3 /etc/pihole/pihole-FTL.db "DELETE FROM network_addresses"

2 Likes

@powloo — Thank you.