Client Names based on MAC addresses

I'm using Pi-hole with an Eero router. DHCP cannot be disabled on the Eero and the Eero does not provide local name resolution via conditional forwarding. I've given all of my devices names in the 'Clients' section of the web interface which is based on the MAC address. MAC address naming seems preferable to ect/hosts as device's IP addresses may change.

A nice feature would be for the Dashboard to use the Client names defined above when other methods of name resolution are unavailable.

Are you referring to your router's web interface?

No, I've defined the Clients on Pi-hole using admin/groups-clients.php. So the Pi-hole has a name ('Comment') for every device on my network, having this as an option for client naming on the Pi-hole dash (in the absense of the Eero providing name resolution via conditional forwarding) would be great.

Please upload a debug log and post just the token URL that is generated after the log is uploaded by running the following command from the Pi-hole host terminal:

pihole -d

or do it through the Web interface:

Tools > Generate Debug Log

Token is LNMrDLap

While they are used in DHCP, DNS is oblivious of MAC addresses.

Your debug log shows you currently do not have enabled Pi-hole's DHCP server (but it has been in the past).

That would be the correct place to associate names to DHCP clients, potentially overwriting the name a client tries to claim for itself - provided that Pi-hole is your DHCP server.

If your router is your DHCP server, that service falls in your router's scope.

A DHCP server may register a hostname (as presented by a MAC client during DHCP lease negotiation) for an IP address with its co-located DNS server, but there is no specification requirement to do so.

While Pi-hole's DHCP server would automatically create the respective DNS records, your router's DHCP server may not.
You may verify by running a reverse lookup for one of your client IPs directly against your router's IP, e.g.

 nslookup 192.168.1.21 192.168.1.1

Your router should return the correct name for 192.168.1.21.

If it does, you can configure Pi-hole to retrieve local names from your router by enabling Pi-hole's Conditional Forwarding.

If it doesn't, you could consider to create the necessary Local DNS records via Pi-hole's UI, which stores its name/IP associations in /etc/pihole/custom.list (where you could also bulk edit your definitions).
This has to be done only once, but of course it would only be sensible if your router would always assign the same fixed IP address to a client. In order to succeed with that, you may have to disallow clients to randomize a different MAC address any time they connect to your network.

Client Group Management is the wrong panel to use.
It is intended to define specific clients that need special filtering, differing from the default.

In particular, this means that you won't need to define clients that will be subject to Pi-hole's default filtering group.
Your debug log shows you have defined some 50 clients, but only 5 of them are in a different filter group, i.e. the rest of them (using Pi-hole's default group only) is unnecessary and can be removed.

Unrelated to your question, your debug log shows that you have disabled BLOCK_ICLOUD_PR.
Note that this would mean that devices browsing via Apple's iCloud Private Relay would by-pass your Pi-hole.
Consider setting it back to true and configure the devices to not enable Private Relay for your home network if you want those devices filtered by Pi-hole.

I did used to have Pi-hole running DHCP but my new internet provider supplies an Eero router on which the DHCP server cannot be disabled. It does not support name resolution either >

nslookup 192.168.1.21 192.168.1.1
Server: 192.168.1.1
Address: 192.168.1.1#53

** server can't find 21.1.168.192.in-addr.arpa: NXDOMAIN

One fix is to set the Eero DHCP server to a pool of one single address and let the Pi-hole manage the rest but this caused havoc on my network for some reason.

The Client section was only 5 entires until I added everything else on the network yesterday to see if it would help with client names on the Pi-hole dashboard.

You will - unfortunately - have to be somewhat more specific on what is happening. Like investigating the lease details on any client like which DNS server, gateway address, IP address, and netmask they received once from the router and once from the Pi-hole so we can fix the network behaving badly with Pi-hole being the server if you want to use it as such.


Others than that: What you are asking for is currently possible but not in the way you tried to configured it. This comment field is really this - a comment field - and nothing more. It is really meant to be used as such like "this is my first kid's device, it needs Amazon to be blocked!" so nothing that someone would routinely expect to turn into a hostname of any kind.

So how would you do it? When Pi-hole is your DHCP server, you can define static DHCP leases without an address (so only MAC -> hostname). This way, you explicitly say that said MAC address should always get a specific hostname while you do not care all that much about the actual address.

Implementing this outside of the DHCP realm would be an immense implementation work for something which is questionable in itself (see my comment above about users not expecting their comments to turn into host names and the one by @Bucking_Horn about DNS servers knowing nothing about MAC addresses in principle) and I don't think this would be a useful addition - especially as this is already possible using DHCP leases.

Everything worked perfectly until the Eero with it's forced DHCP server turned up.

For now I've used the Eero to give my devices static IP addresses and updated /etc/pihole/custom.list on the Pi-hole to mirror the entries.

That would also be the recommended way.
Note that if Pi-hole is your DHCP server, Conditional Forwarding should be disabled, as Pi-hole already knows about its DHCP clients' names, and keeping it enabled may close a partial DNS loop.

Im using Pi-hole with an Eero router. DHCP cannot be disabled on the Eero and the Eero does not provide local name resolution via conditional forwarding.

Same setup here with omada router. I want to keep the DHCP on my omada router but unfortunetly got no DNS-Server there.

Would be a really great feature within pihole to optionally identify clients by mac instead of ip. as ip change.

Coming back to the original request:

We kind of do something like that already - at least we try to obtain the host names through other IP addresses of the same device:

We however, do not support using the Clients section of the web interface for this matter, mostly because there is no "name" field. From your screenshot, I see that you are "abusing" the comment field for this, however, it is really a free-text field allowing you to even enter stuff that is entirely useless or even forbidden in the context of host names (like spaces, UTF-8 characters such as ÄÖÜ, etc.). Some work would have to be invested in some canonicalization. Also, we'd need to clarify if this is really a last-resort kind of name resolution or if users may even want to favor this liberty they get here - or if they want to keep the comments as ... well ... comments.

I do not think the is a no-go here but we surely need some more discussion to come to a useful-for-everyone decision.

I ended up settings static IP addresses for everything on my network on the Eero and using local DNS records on the Pi-hole to get the dashboard right. Doesn't help me identify new / rogue devices but as a domestic user that's not really an issue.

If I were using Pi-hole in a corporate environment the abilty to automatically 'label' devices would be very useful. Having used nslookup Eero to query names of IP addresses on the Eero runnning DHCP returned no results so whether this is technically possible seems unlikely in my case.

To be honest, I'd prefer Pi-hole to continue to focus on what it does so very well rather than add code to deal with odd edge cases like mine.

The correct fix would be for Amazon to give us control over DHCP on the Eero I paid for :upside_down_face:

1 Like