With no hosts file, where does Pi-Hole get hostnames from?

Expected Behaviour:

I'm running a standard pi-hole install on a raspberry pi 4, connected to my router via ethernet. (I'm having some issues getting ipv6 working; but I've got the pi-hole working without it so that's an issue for another time.) I'm using the Asus ZenWifi XT8 router, in which I have my LAN DNS pointing to the pi-hole, and the WAN DNS automatically configured. Based on my read of the documents, everything should be showing up as just an IP address until I modify /etc/hosts.

Actual Behaviour:

I'm starting to build out my /etc/hosts file so I can see hostnames instead of IPs, but currently some of my devices are already resolving with hostnames, and some with IPs. The weird part is I can't quite figure out where it's getting the hostnames. They're not inaccurate, exactly, but they also don't match the names I've given the devices in the router. I have an internet connected bed, for example, which is 'bed' in my router settings. But it shows up as a bunch of letters & numbers--not an IP address. And my MacBook Pro shows up as MacBook-Pro.mydomain I know for the computer, there's an entry in network settings for a WINS server but I can't seem to actually change it.

Anyway, I know I can probably override this stuff with the hosts file, but if I can figure out where the names already there are coming from, and change them to my liking, I figure I might be able to save future headaches if any of my IP addresses change.

First read below about Asus routers and the LAN --> DHCP --> DNS setting.
Most likely you wont be able to use the Asus router for DHCP with stock firmware.

Did you configure your Pi-hole to use your router as one of its upstream DNS servers?

I did not.

I've got the pi-hole as the only LAN DNS server on the router, so I sort of assumed that having the router be an upstream server for the pihole would just start sending queries back and forth. Is that not what would happen?

And if I should have my router be upstream, would that be ipv4 or 6?

Thanks!

I asked for the router as upstream because the most likely source for hostnames when Pi-hole isn't your DHCP server would be your router.

Since it is not, let's have look at your debug log.

Please upload a debug log and post just the complete URL containing your token that is displayed generated by

pihole -d

allowing to upload when prompted, or do it through the Web interface:

Tools > Generate Debug Log

So... ran pihole -d, and got this:

[?] Would you like to upload the log? [y/N] Y
* Using curl for transmission.
* curl failed, falling back to netcat for transmission.
nc: getaddrinfo for host "tricorder.pi-hole.net" port 9999: Temporary failure in name resolution
[✗] There was an error uploading your debug log.

  • Please try again or contact the Pi-hole team for assistance.
  • A local copy of the debug log can be found at: /var/log/pihole_debug.log

And FWIW, I've edited etc/hosts so my personal devices now look like how I want, but my folks' devices, for example, are still coming through with names instead of just IP addresses.

EDIT: Tried again a while later, same error.

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