Unknown device names and multiple IPs per one device with pihole as DHCP server

Expected Behaviour:

As I am using pihole for DHCP I thought hostnames would be resolved.

  • Raspberry PI
    Linux pihole 5.10.17+ #1403 Mon Feb 22 11:26:13 GMT 2021 armv6l GNU/Linux
  • Lastest pihole version
  • Unbound installed and configured as per the pihole docs

Actual Behaviour:

I see some devices showing as UNKNOWN in the dashboard.
In the network table I see some devices with multiple IP assignments.
Im also seeing IPV6 addresses, when I have this disabled?



Debug Token:

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

Have you recently made changes to your DHCP server? Some of the IP's are adjacent, which can indicate that the lease was renewed and the DHCP server assigned the next IP in line. When Pi-hole is the DHCP server, IP's tend to be scattered across the allowable IP range, since the deterministic DHCP server in dnsmasq will hash the MAC ID of the client to assign an IP (IPs are typically not assigned sequentially to clients).

These aren't multiple current assignments, this is the history of IP's assigned to that specific MAC ID (or DUID).

From your debug log:

*** [ DIAGNOSING ]: Setup variables
    ...
    IPV4_ADDRESS=192.168.0.45/24
    IPV6_ADDRESS=fe80::2b4c:1685:8a3c:e4b3

The most reliable way to have definite host names show in the Pi-hole interface is to map the client IP's to host names in the local DNS records tab (or in /etc/hosts on the Pi). You can specify whatever name you like within the limitations of host names. In many cases, clients provide their own host name in the DHCP transaction and the names may not make much sense. Here is an example of a hosts file I use:

192.168.0.120   Apple-TV-MBR
192.168.0.121   Apple-TV-FR
192.168.0.125   Ipad-Pro
192.168.0.126   iPhone-12-Mia
192.168.0.127   Mac-Mini-2012
1 Like

No, ihavent made any changes lately. I noticed this 'problem' a few months back, but left it to see if it would rectify itself.
Sorry for my ignorance (and lack of understanding), what do you mean by 'adjacent IPs'?
Is it something that needs to be / can be corrected?

Did not know this, thanks for enlightening me!
So this is nothing to be concerned about?

So IPV6 is enabled? I defienlty did not, and have not enabled this. I actually have it disabled in my ISP router, due to issues with android

So this is the preffered method over assigning static IPs via pihole?
I was under the impression that assigning static IPs was bad practice in terms of networking?
If I go down the /etc/hosts method, could I not run into an issue whereby the hosts files states, for example IP of 192.168.0.111 to iPhoneA, but pihole assigns a different IP upon connection?

Pi-hole uses dnsmasq, which contains a deterministic DHCP server. Clients will (in almost all cases) receive the same IP forever since the method for assigning an IP is partly based on the MAC ID. This is the functional equivalent of assigning a static IP.

I'm not sure where you may have read that assigning static IPs is bad practice. My router has over 35 reserved IPs for regular network clients. The printer is always at IP 4, the Synology is always at 113, etc. There is nothing fundamentally "bad practice" in doing this.

If you have reserved IP's in the DHCP server and then you set the same static IP on an individual device you can end up with IP conflicts. This would constitute bad practice.

Ah ok, can't remember where I read it. Perhaps I interpreted something wrong. Very possible.
I think I'll try the /etc/hosts method, purely because I've never done it and it will be a learning opportunity.

Out of curiosity, what is the difference / pros / cons of using IP reservation over static DHCP leases?

In terms of my network table, is there a real problem with the screenshot I posted above, or is this normal / OK behaviour?

And IPV6? Which I thought was disabled

Static IP's are typically set at the client, and this will override any IP offered by the DHCP server.

Reserved/static IP's in a router are reservations. You are telling the router to save a specific IP to be assigned only to the specified client. Using this method provides some feedback from the router - it won't let you assign the same IP to multiple devices.

For my network (router and six Pi-holes) I prefer to do the DHCP work at the router. I reserve IP's for all my regular network clients, and then put the same entries into the /etc/hosts file on each Pi. Then, regardless of which Pi-hole a client chooses, the same name will show up in the Pi-holes.

Then, in the hosts file on each Pi, I have this:

192.168.0.1     TC-Extreme-3TB
192.168.0.2     TC-Extreme-3TB-extender
192.168.0.3	    Airport-Express
192.168.0.4     Brother-Printer
192.168.0.90    Sonos-Beam
...

Nothing I would worry about.

You are seeing link-local addresses. Also normal.

Thanks for explaining, appreciate it.
The router i have is provided by my ISP and is pretty locked down, hence using pihole for DHCP.
I only have one pihole, which more than OK for my small home network, so perhaps using /etc/hosts file is not really required. Especially as i am using pihole for DHCP, which can also assign static IPs.
Something for me to ponder!

I have one final question on this topic...well related, thought I'd ask here, rather than open a new thread

I have mapped some IPs in /etc/hosts
One of which is a wifi booster that has a web gui.
hosts record looks as such

192.168.0.2    skyqbooster

Should i be able to access the web gui by browsing to skyqbooster.lan?
I cant, also tried using the local DNS entry record in pihole settings...same result

No, because the domain you have mapped does not include the lan suffix.

skyqbooster and skyqbooster.lan are two different domains.

ah ok, i thought pihole added the .lan as per the settings:


So i guess i need to map skyqbooster.lan in /etc/hosts

EDIT:
Should also add, browsing to just skyqbooster or http://skyqbooster does not land me on the admin gui at 192.168.0.2

That behavior is dependent on the configuration of the browser at that IP. What device is at that IP?

It is an ISP provided wifi booster / AP.
I have set it at the IP of 192.168.0.2
My router is at 192.168.0.1
DHCP range is set from .51 through to .251
browing to 192.168.0.2 lands me at the gui (not http:// required)

Changing the /etc/hosts to have .lan does not seem to make a difference

Are you able to access the GUI if you enter the entire URL with the domain name?

i.e. http://skyqbooster.lan/...

No, it returns 400 Bad Request

Nslookup:

pi@pihole:~ $ nslookup skyqbooster.lan
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   skyqbooster.lan
Address: 192.168.0.2

pi@pihole:~ $ nslookup 192.168.0.2
2.0.168.192.in-addr.arpa        name = skyqbooster.lan.

I think this problem is outside of the scope of Pi-hole. Pi-hole resolves the domain name to an IP, as intended.

What the endpoint website does is outside of what Pi-hole controls.

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