Pi-Hole DHCP Hostnames to Router/Fing

Please follow the below template, it will help us to help you!

Expected Behaviour:

Pi-Hole Hostnames to show in Router Wifi settings and Fing mobile app.
Pi-Hole to show all IPs connected to router.

Actual Behaviour:

I’m having a bit of trouble with something I’m not sure is possible with Pi-Hole.
First off, here are some settings I have that may help with understanding my setup:

I’m using Pi-Hole as my DHCP Server.
In Pi-Hole DNS Settings, I have both IPv4 checks for Google checked.
In my modem/router settings, I have DHCP disabled.
My modem/router DNS Settings are very simple:


Of course, 192.168.2.69 is my Pi-Hole ip address.

I have set static IPs and Hostnames in Pi-Hole for most of my devices. Unfortunately, the hostnames I’ve set for them do not show up with the same hostnames in either my Router or on the Fing app on my phone.
Also, there are devices that are listed in Pi-Hole that aren’t listed on Fing or the Router; devices on Fing that aren’t on the Router or Pi-Hole; and devices on the Router that aren’t on Pi-Hole or Fing.

Is there something I’m doing wrong?

I like to use both the router and fing for the options that aren’t available in pi-hole. Also, fing is pretty easy to fire up on my phone to check for an ip address quickly.

I initially set up Pi-Hole because I had an extra Pi Zero W hanging around and it was the easiest way to circumvent the lack of NAT-Loopback/Hairpinning options on my Modem/Router combo with dnsmasq.
Now that I set it up, I’m loving the other features of it. Thanks so much to the devs for this awesome product!

P.S. Here’s an example of what all 3 show for the same device:

This guide might help you to configure hostnames to be available on more than just the Pi-hole, and we're working on a slight update to it as well:

I know what your problem is, more or less. The issue is you want to have all of your managing devices (router, pihole, Fing, whatever that is...) display identical hostnames. I've got it to work on my setup but its not as easy as I think it should be.

The problem is that hostnames don't propagate from one managing device to another. The answer is that you have to manually configure each of your managing devices with the same information. I haven't uncovered why this information isn't automatically shared from, say the gateway router to the other devices. Maybe there's a good security reason or maybe nobody has taken on the task.

To make this work I first set my gateway router as the DHCP server and used its web interface to set up static ips and hostnames by mac address for all of the devices.

Then, on the pihole, I edited two files by hand. Keep in mind that there may be some sloppiness here, I'm new-ish to linux and networking.

File 1) Made a new file called /etc/hosts.hom in which I included the same IP/hostname information that I did on the router. Each entry should follow this simple format:

ipaddress hostname
so
192.167.17.90 dentarthurdent

Note that the mac address isn't necessary since the router is the one giving out IP addresses. This file just tells the pihole what name to use based on the IP address given out by the router.

File 2) made a new file -- /etc/dnsmasq.d/99-overrides and put these lines in it:

addn-hosts=etc/hosts.hom
domain=hom
local=/hom/

Of course, if you don't care about specifying a lan domain you can ignore lines two and three. I think. (If you do care, you'll have to set up the domain name on each device...) The main thing is that pihole reads and runs all of the files in /etc/dnsmasq.d/ and it will therefore obligingly load the hostnames and whatnot from whatever file you tell it to with the addn-hosts=xxx bit. Hosts.hom could be Pangalatic.Gargleblaster if I understand.

You'll have to decide if its worth it to learn how to tailor your Fing device with this information. If its not possible in the app itself I bet its possible to configure your phone's OS to use those specific hostnames. I'd bet more if it was android, very little if its an Iphone. But I don't know. Good luck. :wink:

EDIT:
It just occurred to me that I complicated things but for a reason. I think you could technically edit just one file on the pi: /etc/hosts

I did it the long way because since I've been at this, I've seen that file altered and overwritten. This way I know my edits will remain intact.

2 Likes