Pihole dhcp > no hostnames on router

The issue I'm having is the display of hostnames. If the router manages DHCP, then the Pihole shows no hostnames. Likewise, if the Pihole is handles DHCP then the router doesn't know the names.

Right now, the PI is my DHCP server. Isn't there a way to have the router automatically read hostnames from the pihole, or have the pihole transmit them to the router? Or is it truly necessary to manually update the hostnames into the non-DHCP device?

In case this helps, here are the relevant devices.

Linksys wrt1900acs v2 running Gargoyle
Pihole running on a RPI connected to the router via ETH0.

Why do you want the router to see hostnames? Does it have a page of clients you want to access? Try setting the router's WAN DNS server to the Pi-hole.

Why? Hmm. I suppose because its easier to survey the network landscape if I see hostnames along with the IP address on the router's configuation pages. Pretty much the same reason DNS was invented; names not numbers.

I should mention that the Pihole works great. It blocks ads like a boss on all devices. As far as I can tell its working as intended. The router's WAN DNS has pointed to the Pihole since day one.

I'm not sure how much this has to do with the Pihole directly. It isn't related to blocking ads, I don't think. My thought was that perhaps for this to happen, there is some combination of dnsmasq settings that would do it. But I don't really know.

But since nowhere on the web could I find anything about other people having this problem, I'm wondering if its even possible. Either its working like I think it should for everyone else but me, or nobody else minds the lack of hostnames. I've been trying to puzzle this one out for a few weeks and am at wits end.

Can I do it? If so, how?

I'd think that if the router has the Pi-hole as its DNS, then it would be able to look up hostnames. Otherwise, you can use the Pi-hole's DHCP section of the settings to see all the device hostnames (I believe).

Turns out I can resolve hostname or hostname.mydomain but only from the Pihole. All connected devices, and the router itself from SSH, will not.

You're right that hostnames show on the pihole admin page. But the router hosts page also includes other information associated with the hosts as well as the network at large. So its very useful information to have in the router for all kinds of administration purposes.

In fact, I switched over to using the pihole's DHCP server precisely because it was recommended in other forum threads that doing so would solve the resolution problems. Alas.

Just to be clear, you're saying that local domain and hostname resolution should work out of the box?

I don't use the DHCP part myself, so others would be better suited to answer that question. I'd expect that since the Pi-hole knows the hostnames and can reverse-lookup them, then clients should be able to query the Pi-hole in the same manner. I know that there's a feature exposed in the DHCP settings to generate domains such as hostname.local, which should allow any client to go to that domain and connect the that host.

My router and pihole both have places in the web config to specify the local domain, which I filled out. This didn't work. So because most threads surrounding this issue mention this "fix", I added

domain=castle.hom
Local=/castle.hom/

to /etc/ hosts on the router and on the pihole. This didn't work. Pinging any device in the form of hostname.castle.hom from the router CLI responds with: ping: bad address 'hostname.castle.hom'

So then I added the domain info to /etc/dnsmasq.d/01-pihole.conf as per this thread. Reboot PI,reboot router, no joy.

You yourself brought up gravity.list in that same thread. At the top of my gravity list is the Pihole's address, followed by 0.0.0.0.

It doesn't look right to me, but I don't know what should go there so I didn't change it.

Other threads I've seen are just rehashes of these same steps. As I said, it all works fine from the pihole. But only from the pihole. There's something else going on here that I can't diagnose myself. Must. Not. Give. UP!

Hey jayray,
Did you end up figuring this out?
It's kind of frustrating as I use the router for certain things that Pi-Hole doesn't offer. I also use the Fing app from my phone to quickly get ip addresses. Fing shows different names than my router which shows different names than pi-hole. :frowning:
Also, there are devices that show in only one of the 3 but not on the other 2. So weird.

Yeah, I cracked the hostnames thing. I don't know if its the only answer but its been working so I stopped messing with it. I answered in better detail in your other post. All in all it feels like a bit of a workaround. For whatever reason the protocols that build the internet don't seem to work that way automatically.

I don't have anything helpful to add about the other thing with the clients, sorry. There does seem to be something similar in those two issues, doesn't there? Both involve the withholding of information from one device to another. But I'm sure that what worked for the hostnames problem is of no use here.

1 Like