First time using docker containers and decided to move from baremetal Pi-hole to the container image! Loving it all so much so far. I noticed though in my new dockerized pi-hole that mac addresses are missing from the client list making my custom filter rules not work.
I did use the teleporter. There are mac addresses in there but I don't think the container can see the macaddresses on the broader network only the IP isn't that true? I noticed my client list drop down no longer shows macaddresses just IPs.
Yes, by default, Docker would use its bridge network mode to isolate containers into a separate subnet and link.
You should also note that the DNS protocol does not include MAC address information at all - the source IP as contained in a DNS packet is the information used to identify the requestor, making IP addresses the most reliable way to identify Pi-hole's clients.
While Pi-hole puts in additional effort beyond DNS to associate MAC addresses with IPs by inspecting the system's neighbourhood tables, this information is acquired by deference only.
And as MAC address randomisation grows more and more common among modern OSs, it becomes less reliable as a means to identify clients over time.
In addition, as MAC addresses have same-link only visibility, they are only ever useful to associate clients observable on the same link that Pi-hole is connected to. Certain additional network equipment (like layer 3 switches or routers) would aggregate their clients traffic under their own MAC.
That's also why PI-hole's web UI recommends:
Note that client recognition by IP addresses (incl. subnet ranges) are preferred over MAC address, host name or interface recognition
Of course, it would be preferred that your router would assign a fixed IP address to the same client.
Hi there. Thank you so much for this explanation. Great point on the MAC address randomization. I’ve definitely battled with that on my personal iOS devices haha.
I also feel so silly. I completely missed the comment in the web UI about using IP instead. I’m going to move to doing it that instead of MAC address and just make sure they are static via DHCP.