Not showing hostnames from 04-pihole-static-dhcp.conf file

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

Expected Behaviour:

Hosts with DHCP reservations should be listed by their hostnames under "Top Clients"

Actual Behaviour:

Cilents are only shown by IP address.

I should preface that I am running Pi-hole on my Fedora 30 Server, which, I've already been told is not officially supported as of yet. None-the-less, it is functioning properly, other than the status showing up as unknown. I believe this is more of a function of running Apache versus lighttpd, as there are other users reporting this behavior as well using Apache. My admin console is also running in SSL. This may also be a factor.

I am running two subnets on my network; one for LAN (192.168.1.0/24), one for IoT devices (192.168.2.0/25). I have Pi-hole setup to hand out DHCP reservations for my LAN network, and my router hands out addresses for my IoT devices, but directs DNS to PiHole. I have a subinterface on my server for the IoT network, and it is functioning properly, communicating with the IoT traffic. I would prefer Pi-Hole to hand out reservations for both, but I've been unsuccessful in my attempts.

As a workaround solution I'm reserving DHCP IPs on my router for my IoT devices, and have added hostnames to /etc/hosts for those devices. Pihole recognizes those hostnames in the console, so that is working for my IoT devices. What is not working, is my LAN devices, controlled by PiHole. The DHCP reservations in 04-pihole-static-dhcp.conf are not showing up in Pihole's known clients list.

Debug Token:

https://tricorder.pi-hole.net/yhjlb5ssjz

Only when devices actually acquire an IP address through DHCP from Pi-hole, they will advertise their hostname to Pi-hole and show up.
Its not sufficient to just create a static DHCP reservation only.
If they dont acquire IP through DHCP (eg. static IP address configured), you can put them in the /etc/hosts file on Pi-hole that will be read once by pihole-FTL when it starts (at boot).

Make sure nameserver for Pi-hole is 127.0.0.1 on the local loopback interface where pihole-FTL is listening:

pi@noads:~ $ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1

pi@noads:~ $ tail /etc/dhcpcd.conf
#fallback static_eth0

interface eth0
  static ip_address=10.0.0.2/24
  static routers=10.0.0.1
  static domain_name_servers=127.0.0.1

I had another DNS server configured and for me the hostnames didnt show up either until I restored to default 127.0.0.1.

Okay, that makes sense. Is there a way to clear out the old Network entires? On the Network Overview tab, it's showing multiple entires for IP addresses; some, without hostname. Now that Pihole recognizes the hostnames, I need to clear out the old entries, for the Top Clients to show the correct entries.

Below for the ARP cache network database table (includes a backup):

Below for the queries database table but replace step one with below one:

sudo -u pihole sqlite3 /etc/pihole/pihole-FTL.db

1 Like

Excellent. Thanks so much. Should be a feature request to have a clear ARP tables or something like that. I had to shell script it to remove a large portion of the older arp entries:

for i in {*start*..*end*}; do sudo -u pihole sqlite3 /etc/pihole/pihole-FTL.db "DELETE FROM network WHERE id = $i"; done

And then I did the one off's that were bad entries. Now my Network entires are much cleaner.

2 Likes

Nice.
You could have shot down those one off's with the same shell line :wink:

for i in 4 8 13; do sudo -u pihole sqlite3 /etc/pihole/pihole-FTL.db "DELETE FROM network WHERE id = $i"; done

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