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?
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).
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:
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?
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.
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
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