Trying to determine all the sources for hostnames

I have queried on this before on PiHole shows a GoogleHomeMini hostname for Vizio TV - Help / Community Help - Pi-hole Userspace, and my setup is basically the same as before.

My question: what are all the sources Pihole uses to try and determine device hostnames? In addition to the smart TV mentioned in the linked post above, I have another device that previously had a Pihole-assigned name (under Local DNS Records). I have removed that Local DNS entry with the intention of having the device name come from either the device itself or my router. I also purged this specific item from Local DNS Records.

Within a few minutes, the device name repopulates under Local DNS Records using the now-deleted name assignment I had created earlier, ignoring what the router sees as the device's name.

For reference, this device is an iPad Air. The device in the linked post above is a Vizio TV. Also, prior posts included suggestions to alter DHCP scope slightly, and this had no effect on the issue.

It also seems my local device name lookups are all handled by 192.168.1.1 (router main network) instead of the gateway IP for my guest network (10.10.0.1) based on the results of dig commands, not a problem, just FYI.

Obviously this is all cosmetic and not at all important in the grand scheme of things. My concern is that it might be a symptom of a larger issue with how Pihole is storing obsolete system names.

Debug token is https://tricorder.pi-hole.net/aEd1WGv7/.

A device does not register its name directly with DNS.
A device may send its hostname to a DHCP server during DHCP lease negotiation. It then depends on the DHCP server whether that would register the requested hostname with a DNS server, e.g. by default dnmsasq would do so, as would pihole-FTL if Pi-hole's DHCP server is enabled, but ISC DHCP server wouldn't .

Pi-hole will read hostnames according to its dnsmasq configuration.
By default, it will read /etc/hosts, /etc/pihole/local.list and /etc/pihole/custom.list.
If Pi-hole's DHCP sever is active, it may store hostnames in 04-pihole-static-dhcp.conf, and it may also consider information from its DHCP leases /etc/pihole/dhcp.leases.
Pi-hole will also use any custom hostname configurations, like host-record, cname, addn-hosts definitions etc. that appear in its dnsmasq configuration - in your case, there's 02-pivpn.conf pointing to an extra hosts file.

Pi-hole will also try to source hostnames of its local clients via reverse lookups regularly (once per hour), either through its regular upstreams or through its Conditional Forwarding target IP address, if configured accordingly.

It may store names learned that way in its database.
You may control how it does that via a set of pihole-FTL.conf options (NAMES_FROM_NETDB, REFRESH_HOSTNAMES, MAXNETAGE).

But before you start playing with those options:
When we checked this last for your Vizio TV device, your router has been the source of the hostnames.

You should once again verify what your router would return for the hostname in question, by forcing normal and reverse lookups to your router's respective IP addresses, e.g. for a device named mini at 10.10.0.51 and yor router serving to subnets at 192.168.1.1 and 10.10.0.1:

nslookup mini 192.168.1.1
nslookup mini 10.10.0.1
nslookup 10.10.0.51 192.168.1.1
nslookup 10.10.0.51 10.10.0.1

If your router is the source of those unwanted hostnames, my previous advce would still apply:

2 Likes

may I also ask a question regarding this topic?
I hope its not completely the wrong, but for me it sounds like a similar thing.

Is there a way to give all thos cryptic hostnames the real name?

All IPv6 devices are only listed with a long cryptic ID.
All Ipv4 devices have the correct name. For example: notebook1.local

edit: my pihole is DNS & DHCP at the same time. So it should know the names I think. If I switch to fritz box as DHCP, its working fine. strange....

Regards,
V.

I had a detailed response all ready, but after some poking around, I finally got PiHole to show "viziotvbedroom" for 10.10.0.51. I went to the TV and told it to "check for updates." Now the host name shows up as expected. Your input (again) ultimately led to the solution!

That device name "6-beths-ipad" on IP 192.168.1.65 is not what the device presents as its name, nor is it what's set in my router. The only place that name ever existed is when I was temporarily using a Local DNS record in Pihole to assign the IPv6 address to that name; I deleted it several days ago and it still shows in Pihole/Tools/Network and Dashboard, but I think I understand better what triggers the host name. Not a big deal, and the iPad is the only device still exhibiting this behavior. Perhaps it won't forget that Local DNS record hostname until the next time I do some specific task on the iPad in question.

I appreciate the guidance, @Bucking_Horn. Your instructions and explanations are always thoughtful and patient; don't think it goes unnoticed!

1 Like

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