Did you edit
Did you edit
No, not to fix the lost ability to show host names instead of IP addresses in the admin panel.
I misunderstood the problem.
You would map IP’s to host names in
/etc/hosts. The file
/etc/pihole/local.list provides the name for the Pi itself and maps the name pi.hole to the Pi IP address (as does
Is there a way to make Pi-hole pick the nicer name, other than resorting to hard-coding names in /etc/hosts ?
Unless you can clean this up in the router, no.
Thanks for your quick reply
The router just gives me the option to assign a name to a given MAC address, which I already did. The cryptic name is obviously injected by the android device itself (where I can’t change it).
How does Pi-hole derive at the host name to display for a given IP address, if there is more than one name for it ?
If it doesn’t get if from the router, it looks in /etc/hosts. I recall that the hosts file will override the router name. Add a few IP’s to the hosts file and see if this shows the name you want. Here are a few examples of entries I have in the Pi hosts file - these are the names that show in the Pi-Hole web admin interface.
192.168.0.1 Router 192.168.0.100 Pi-3B+ 192.168.0.101 AirportExtreme 192.168.0.102 Printer 192.168.0.108 Sonos1L 192.168.0.109 Sonos1R 192.168.0.110 SmartThings-hub
Yes, I am aware editing
/etc/hosts will allow me to override router issued names, but that approach seems only feasible for devices with fixed IP addresses.
My current hosts file just contains my Pi-hole’s name, so Pi-hole has to retrieve host names from my router - hence my question how Pi-hole does derive at a single host name if the router offers multiple names.
But that is more out of curiosity, and perhaps a bit to weigh if this could be rephrased into a feature request or whether this is not accomplishable at all.
What do you think, would this make a promising candidate for a feature request?
No need to rush an answer, I have to log off now anyway to catch some sleep - thanks for your help today
The solution likely exists already - use Pi-Hole as DHCP server. You can assign static leases, etc.
I like your way of thinking, jfb - you really try to find a solution within the given limitations and available feature sets of Pi-hole
For now, I chose to follow your suggestion and enabled DHCP again, as it was helpful anyway when trying to assist with Pihole plus Guest Wifi on different IP range
I dimly recall I had my reasons when deciding to use Pi-hole as DNS-server only, but I can’t recall why (lack of documentation on my behalf ).
I’ll keep playing around with it for just a bit more and let you know if this fits my setup.
Thanks for your help so far!
one of the reasons I went with using PiHole as the master DHCP was because there are various paremeters on the ISP facing router that I can’t edit/change.
a) the hostname of the router
b) change the static DNS issued by the router (it always tells clients to use itself and then it looks at whatever DNS you have told it to use)
Upshot of this was that all queries for all devices going through this router appeared to come from the router and not from the individual devices.
This might be helpful if you want Devices to have a more friendly host name but still be issued Dynamic IPs (although it does still need populating)
At the bottom of the DHCP conf page in the web gui it says
“Specifying the MAC address is mandatory and only one entry per MAC address is allowed. If the IP address is omitted and a host name is given, the IP address will still be generated dynamically and the specified host name will be used. If the host name is omitted, only a static lease will be added.”
Thanks, I’ll give that a try sometime during the week.
For now, weekend’s over
So, I have used Pi-holes DHCP for some time, but are not really comfortable with it.
While it allows me to manipulate host names, it is somehow limited in doing so.
It seems Pi-hole currently allows only one entry per MAC, defining a host name and one IP address with it.
But alas, some of my devices have several IP addresses. I can get rid of a lot of them by disabling IPv6, but some devices remain.
This is owed to a specialty in my setup:
I have caged my TV into a separate wifi subnet (with limited range) to prevent it from using DNS servers of their own devisal (I achieve this by NATing the DNS requests to Pi-hole).
I now use some of my devices (smartphone, tablet) as a remote control for that TV. This forces those devices to a roaming usage of the TV’s wifi and the normal wifi.
Pi-hole allows me to issue a static lease just once per MAC, which limits static lease usage to just one sub-network. As Pi-hole is not fully aware of the second subnet (TV), the device ends up with different IPs almost any time it’s connecting. Over time, this leads to a whole bunch of different IPs clogging up in the Query Log that are actually associated with just one device.
I acknowledge that while it doesn’t match my special needs, all proposed solutions are well worth trying in a conventional plain vanilla setup.
I have since switched back to my DNS only Pi-hole.
When doing that, I encountered an error:
Switching off DHCP with static leases configured leads to a situation where Pi-hole refuses to restart FTL. This seems to be caused by a leftover file
syslog also complains about permissions on
Deleting the file and restarting the Pi-hole machine resovled this for me.
Are you already aware of this, or would you want me to open an error topic?
This sounds very similar to the behavior I see with IPv6.
My router provides DHCPv6 that cannot be turned off, which in turn leads to highly mobile devices such as cell phones and tablets to be assigned new IPv6’s frequently.
Leading to my log files being full of hexadecimal listings that are all really just one or two devices.
I asked a question here (no responses yet) about IPv6 specific conditional forwarding, but maybe it would be more useful to have “IP range” conditional forwarding so that whether it’s an internal subnet (your TVNet example) or my router IPv6 issue, the Pi-Hole could resolve and concatenate under the assigned DNS name.
Or maybe a way to “tag” MAC addresses with a name so that no matter what IPv4 or IPv6 they end up using they are logged as the designated name? (Though this wouldn’t scale in a SMB or Enterprise environment, it could be a good “gap” measure until the IP conditional forwarding makes it into the Development cycle.)
Re tagging mac addresses with a name, yes you can, no idea if it will help though
That works for fully dynamic, but I haven’t figured out how to make it work in a mixed environment.
E.g. for IPv4 I use a firewall to ensure that my devices are unfiltered, but for my friends and family the network is “filtered” a bit more strictly (I have underage nieces…).
In my specific case, I assign a static IPv4 to my devices for this filtering, but can’t do anything about IPv6 due to my carrier’s hard-coded configs on the router.
Now if that same configuration area could handle both a static IP and a masquerade “un-IP’d” name it would work.
Maybe it’s a bit less coding work to perform the duplicate check for MAC, validate that the IP assignment is “NULL” on the duplicate and allow it with a warning /verification?
in which case it might be better doing custom queries direct on the DB as outlined here
I asked for instructions on picking a specfic host name from a given list of supposedly many.
Setting up DHCP was proposed as a possible solution by @jfb, which I tried for a few days and now commented on.
I have no difficulties with IPv6 whatsoever, nor do I struggle with hostnames in general, so your problem seems completely unrelated.
In case I missed your point: Would you care to elaborate on which solution you are offering for my problem?
I don’t get it: How does that help me making Pi-hole pick a specific host name?
that was more a lateral suggestion for @PatienceofStone
Now where’s that darned quote button!!!
Ah blockquote, copy’n’paste
What a PITA ;o)
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.