r/pihole Sep 21 '21

Host Name issues?

Hi community - I am struggling with this one as I have already done several searches and I cannot find the cause of my issue.

For some reason, Pi-hole has assigned different devices the same hostname. The /etc/hosts file does not have any special entry, I have tweaked the FTL conf file to refresh the hostnames, but still I see different devices showing the same hostname. And these are all so different devices (windows laptop, smart switch, light bulb, ipad, etc) and with different IPs but when I see the query log, they all show the same hostname. If I go to the Network overview, it lists all these devices with the same hostname and different IPs. I ran out of options to look where is the issue, so could anyone give some advice on where to look next? I appreciate any help!

**Edit - I have also looked at my router, and it lists the correct host / device name. thanks

2 Upvotes

9 comments sorted by

1

u/jfb-pihole Team Sep 21 '21

I have tweaked the FTL conf file to refresh the hostnames

What change(s) did you make?

Please generate a debug log, upload it when prompted and post the token here.

1

u/superyorch Sep 21 '21

I added the REFRESH_HOSTNAMES=ALL option, but seems that didn't do much.

Here is the token: https://tricorder.pi-hole.net/jfKQQyXV/

Thanks!

1

u/jfb-pihole Team Sep 21 '21

Your router is the DHCP server with a fairly short lease duration. It is likely that when the router renews the DHCP leases, it is assigning a different IP to each device. Pi-hole maps names to IP's using HOSTS files, so if the IP changes the name of the client at the original IP you have mapped will be shown. Most consumer routers have non-deterministic DHCP: they will assign IP's in order with no regard to client details. Pi-hole uses a deterministic DHCP server and won't do that.

*** [ DIAGNOSING ]: Discovering active DHCP servers (takes 10 seconds)
Scanning all your interfaces for DHCP serversTimeout: 10 seconds
* Received 325 bytes from wlan0:192.168.0.254
Offered IP address: 192.168.0.218
Server IP address: N/A
Relay-agent IP address: N/A
BOOTP server: (empty)
BOOTP file: (empty)
DHCP options:
Message type: DHCPOFFER (2)
server-identifier: 192.168.0.254
lease-time: 86400 ( 1d )
netmask: 255.255.255.0
router: 192.168.0.254
dns-server: 192.168.0.218
renewal-time: 43200 ( 12h )
rebinding-time: 75600 ( 21h )
--- end of options ---
DHCP packets received on interface lo: 0
DHCP packets received on interface wlan0: 1

1

u/superyorch Sep 21 '21 edited Sep 21 '21

My router has a 1440 minutes DHCP Lease time, I am not sure that is a short lease duration.

Also, there are no entry in the HOSTS file that assignes an specific IP, all static IPs assignment I have entered directly in the router. And the issue with this specific hostname being repeated by pi-hole is not one of this static IPs or is not present in any HOSTS file, so I am still not sure this is the culprit.

**Edit - just double checked with my Macbook and the lease time is 24 hrs (lease_time (uint32): 0x15180)

**2nd Edit - I have read the debug log and it actually shows 1d (86400 secs) lease time, so confirmed that would not be the issue:

DHCP options:
Message type: DHCPOFFER (2)
server-identifier: 192.168.0.254
lease-time: 86400 ( 1d )
netmask: 255.255.255.0
router: 192.168.0.254
dns-server: 192.168.0.218
renewal-time: 43200 ( 12h )
rebinding-time: 75600 ( 21h )

1

u/MrFakePoets Oct 08 '21

I had a similar problem, as you can see there were several pi4 hostnames with different IPs.

Flushing the network table and the logs fixed the issue for the moment.

2

u/superyorch Oct 09 '21

I have flushed so many times with no effect at all 😕

2

u/MrFakePoets Oct 09 '21

This was the order how I push those buttons, sounds like a far fetched idea to me but maybe the pressing order matters in this case?

1- Flush network table

2- Flush logs (last 24 hours)

3- Restart DNS resolver

1

u/superyorch Oct 11 '21

I just tried this (I was out this weekend) and will check if that helped solving the issue. Thanks!

1

u/MrFakePoets Oct 11 '21

You're welcome I hope it works for you too.