What are the conditions for local hostname resolution?

@Bucking_Horn

i've done a little investigation

I tried running arp from my raspberry terminal. Only my router returned a hostname. No hostnames even for devices, which have been assigned by pihole via DHCP.

A couple of known devices weren't showing in there either (even IP) but i pinged them and they subsequently appeared when i re-ran arp (still only IP addresses, even though e.g. my printer - one of the missing devices - has a hostname assigned to it under its own network config)

Any thoughts on this?

regards,

Gary

Depending on the actual command used, this seems like normal behaviour.
arp results are volatile, so they change over time as they reflect same-link network neighbours as recently observed by the node it was executed on. Results can be expected to differ on different machines, even if they are connected to the same link.

This is the expected behaviour.
(Matching Currently active leases with Static DHCP leases configuration can be done via Settings|DHCP)

Unfortunately, as I am unable to reproduce your issue on my systems, this means that I'm running out of possible explanations for your observation.

:cry:

thank you for your efforts

some thoughts:

  • could it be anything to do with my Raspbian version or OS installation?

  • i might try a pihole fresh install - best way to wipe my existing installation?

    • the teleporter backup that i used during my installation came from a damaged pihole installation (i'm just grasping at straws now)
  • i was thinking about playing with these settings. Are changes active immediately or do i need to restart the DNS resolver?

    • conditional forwarding (as that actually improved hostname resolution previously)
    • Never forward non-FQDN A and AAAA queries
    • Never forward reverse lookups for private IP ranges

regards,

Gary

I don't think that your OS is contributing to your observation.

We have previously verified that Pi-hole is properly aware of hostnames for its clients:

Pi-hole being aware of a local hostname would allow it to populate the dashboard with that hostname instead of that respective host's IP. This would be particularly true if your Pi-hole also has issued the DHCP lease for that host.
I have no idea why you are only able to observe IP addresses. :thinking:

We've also established that your router is unaware of local hostnames (as would be expected since it has relinquished its DHCP server to your Pi-hole):

Now, as Conditional Forwarding would query your router for local hostnames, it would not do any good to address your issue.

Hmm, I don't think so, but that's an interesting piece of information - I'll pass that question to the team, if you'd be willing to wait for their input.

But if you're eager to try a new installation, I'd possibly go for a blank slate, so start from a fresh OS image.

hi mate

I am such a noob with linux. Please excuse me. I thought pihole had to interact with various other OS components and/or avoid conflict with them e.g. dnsmasq, network manager, etc

There are various .conf files which i know relate to DHCP and DNS e.g. dnsmasq.conf, resolv.conf, dhcpcd.conf

On this topic, i was reading this thread (Problem with local hostname resolution) and made some interesting and/or alarming discoveries

  • resolv.conf has an IPv6 name server listed in it! :see_no_evil:

    • i have IPv6 disabled on my main host (my windows daily driver) so wouldn't have noticed, had i not read keith's thread and performed the tests you asked of him
  • i never knew my router had IPv6 active on it. It's part of the router WAN configuration, rather than to do with my local network. i only realised because Keith appears to have the same or similar router to me

    • i haven't disabled IPv6 because i wanted to discuss the implications with you
  • just to confirm, IPv4 DHCP IS disabled on router (i triple checked)

  • i checked dhcpcd.conf - pihole has the correct static IP and gateway configured but no domain name servers configured. Is this an issue?

    • having said this, i have no external connectivity issues (but there again, on my windows box, i've fully configured my IP with gateway and the pihole IP, so my box knows who and what to talk to, rather than 'discovering' it through DHCP etc)

    • i've not noticed any WAN connectivity issues on any devices i use

i put in pihole's IP address for the DHCP server (not the router)

This is what i did historically and it either made hostname resolution on the dashboard work or improved resolution.

Any thoughts on all this?

Regards,

Gary

No, not as far as Pi-hole's DNS services are concerned.
This setting only affects what the OS on the machine hosting your Pi-hole is using for DNS.

By omitting a DNS server in your static defintion in dhcpcd.conf and moving DHCP to your Pi-hole, you'd probably press your Pi-hole host's OS into using a DNS server as learned via IPv6 NDP/RA.

This would not contribute to your observation, but may pose a separate issue if other clients would also receive that information, and thus be able to by-pass Pi-hole via IPv6.

Depending on which device that IPv6 address belongs to, this may or may not be an issue, abeit a separate one. That said, since you seem unaware of configuring one of your Pi-hole host's IPv6 addresses in your router, it seems very likely that IPv6 would belong to your router.

While this would have to be dealt with, it wouldn't contribute to your current issue at all: Pi-hole is completely ignorant of your network's DNS configuration.
(If Pi-hole would be using the same DNS resolver as your network (which should be Pi-hole, of course), then it would query itself in an infinite DNS loop.)

The important takeaway here is that Pi-hole's own DNS configuration is entirely independant from that of your other network clients. Pi-hole uses only the definitions form its own configuration, and specifically, it would use only those upstream DNS resolvers that it's configured for.

Changing it won't affect your original observation (which your examples tied to IPv4 anyway).

Depending on your ISP connection and the way your router handles disabling of IPv6, that may cut you from internet connectivity, e.g. if your ISP was IPv6 only or DSLite.

Could you elaborate on that?
It's not clear to me where you've put which address.

sorry for the slow reply BH

Thanks.

The only way i've found to configure local DNS on my router is when setting it up as a DHCP server.

I've also confirmed that the DHCP service that the router subscribes to (for its WAN IP) is configured for IPv4 and IPv6 AND both protocols have populated DNS server details (i.e. the router external IPs have 3 DNS servers specified for each protocol)

i've been digging around on my router and the nameserver specified in resolv.conf is the router's local prefix address

yes i agree

hopefully if a client has both IPv6 and IPv6 active, it defers to ipv4

ok noted. ty.

under "use conditional forwarding" in pihole's settings, there are 3 fields

  1. "Local network in [CIDR notation]"

  2. "IP address of your DHCP server (router)"

  3. "Local domain name (optional)"

i used my pihole IP for number 2.

My apologies for jumping onto this thread which I found when searching. I appear to have the same problem as gazzawazza, and may be able to add additional information.

I am running the current latest versions of pihole (V5.14.2 and FTL V5.19.2) on Linux piHole 5.15.61

I am also also running the DHCP service on my piHole because my router (BTHomeHub) will not allow the user to amend the DNS servers.
The "Currently active DHCP leases" table on the DHCP settings page shows "unknown" for all devices EXCEPT for those for which I have created a Static DHCP Lease.
A grep of the hostnames table has a blank after each MAC and IP Address, again apart from those which have a Static Lease assigned.

The Query Log always shows IP addresses not Host Names
Also both "Top Clients" tables on the Dashboard only shows IP addresses.

If another debug file would assist any investigation then just let me know, although I am also a Linux newbie
cheers
Ron

Is Conditional Forwarding enabled in your current configuration?

IIRC, your initial debug log showed Conditional Forwarding to be inactive, so it could not have had an impact on your observation (and of course, it wouldn't make sense to activate it when Pi-hole is your DHCP server).

If you had enabled CF now, you'd point Pi-hole towards itself for certain DNS requests - technically, this would close a DNS loop (if partial), where queries are sent in a circle forever or until timeout.
But since you are running Pi-hole as DHCP server, Pi-hole should supply the answer for known local hostnames straight away before considering to forward them upstream.

thanks BH

what evidence would there be of a loop?

just no resolution of entering a web address?

would anything appear in pihole's log / pihole diagnosis?

btw, in case i don't hear from you, frohe Weihnachten.

regards

gary

hi Ron

Were you able to resolve your problem?

Not that i'll be able to help of course!

Out of curiosity, what OS are you running etc?

cheers,

Gary

Gary,
No sorry, I've given up trying to resolve that problem. Because my router is locked down, I cannot control how IPv6 DNS server addresses are issued, this is a much bigger problem than the hostnames in the piHole logs. I've decided to invest in a new router which will allow me to manage my IPv4 addresses (via DHCP) and DNS servers on IPv4 and IPv6 on the router itself.
Once the router is doing DHCP for IPv4 and piHole is doing the DNS for IPv4 and IPv6 then I will look again at the hostname problem. It will probably be a different issue then !
Good Luck
Ron

A belated merry christmas to you as well. :christmas_tree:

For a partial DNS loop closed by Conditional Forwarding, you may see queries for local and non-dot hostnames time out, and Pi-hole's diagnosis may register rate limits and/or max concurrent DNS requests warnings.

hi Ron

I think you have a the same router as me. UI looks very similar. Linksys velop?

I did find evidence on my raspberry pi that it was picking up IP6 nameserver from the router but that shouldn't be a big issue because my network knows that pihole is the DHCP and DNS server.

The only IP6 stuff i found on my router was WAN side stuff (i'm presuming that's where the name server stuff has come from). Bucking Horn recommended i don't turn this off, in case IP6 was being used by my ISP for my connectivity.

As far as i can see, DHCP on the router (and the potential to nominate DNS server IPs) is limited to IP4.

What router have you decided to go for?

cheers,

Gary

thanks

interesting regarding rate limits

My router was getting rate limited by pihole ages ago - i actually posted about the issue on here - but i resolved this by making pihole the DHCP server.

Can't say whether conditional forwarding was active or not - this rate limiting happened ages ago (Oct 2021).

I've not seen any odd behaviour from pihole, although very recently it's seemed a little sluggish at times i.e. DNS resolution 'appears' slow, in that webpages take a while to load - of course there could be a number of reasons for this.

I turned off conditional forwarding on 24 December, so that can't account for any recent odd experiences.

Gary,
I have installed a TP-Link ER605, this is a SoHo router with no WiFi as I have a Ubiquity WAP installed on my landing ceiling and connected with Cat5E cabling.
The ER605 runs the DHCP server for IPv4 with the piHole IPv4 address set as the DNS Server for the client devices. It also supports IPv6 and I have manually allocated the piHole IPv6 address for distribution to the clients via SLAAC and RDNSS.
This seems to be working as about 30% of my logged queries are for AAAA records and I'm not seeing any ads. However I still need to understand how often the piHole IPv6 address changes and what will happen then.
As far as the original problem is concerned, I'm seeing some client names in the lists/logs. These names are for those devices where I have a Local DNS record setup on my piHole. I will setup more local DNS records as and when I need to investigate unwanted blocks and/or unwanted ads.
Hope this helps
cheers
Ron

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