# Groups and DHCP

**URL:** <https://discourse.pi-hole.net/t/groups-and-dhcp/31901>\
**Category:** General\
**Tags:** v5-0\
**Created:** [May 11, 2020, 3:09am UTC](https://discourse.pi-hole.net/t/groups-and-dhcp/31901 "2020-05-11T03:09:51Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Angrynerd](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/angrynerd/32/13693_2.png) [@Angrynerd](https://discourse.pi-hole.net/u/Angrynerd)\
**Post date:** [May 11, 2020, 3:09am UTC](https://discourse.pi-hole.net/t/groups-and-dhcp/31901/1 "2020-05-11T03:09:52Z")

</div>

Hello, I didn't think this question was suited for the help section so im gonna ask it here. Do you need to use pihole as a dhcp server to use the group managment? I ask because when i go to the clients section of group manager it shows all of the devices it can see on all local networks; however, the only client its actually recieving requests from is the router. Given that its only recieving requests from the router would any of those listed ip addresses actually affect anything?

Thank you for any assistence with this question.  
--Angry

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [May 11, 2020, 3:15am UTC](https://discourse.pi-hole.net/t/groups-and-dhcp/31901/2 "2020-05-11T03:15:57Z")

</div>

> [@Angrynerd](#):
>
> Do you need to use pihole as a dhcp server to use the group managment?

No.

> [@Angrynerd](#):
>
> when i go to the clients section of group manager it shows all of the devices it can see on all local networks; however, the only client its actually recieving requests from is the router.

> [@Why do I only see my router's IP address instead of individual devices in the Top Clients section and Query Log?](https://discourse.pi-hole.net/t/why-do-i-only-see-my-routers-ip-address-instead-of-individual-devices-in-the-top-clients-section-and-query-log/3653):
>
> A nice feature of Pi-hole is that you can see which network devices are sending out the most DNS queries. For every device that is [using Pi-hole as their DNS server](https://discourse.pi-hole.net/t/how-do-i-configure-my-devices-to-use-pi-hole-as-their-dns-server/245), you can also see which DNS queries each one has made. But depending on a few things, you may only see a single host in your Top Clients section, which is not as useful. This isn't detrimental to the performance of your Pi-hole; it just provides you with less insight into [what's happening on your network](https://pi-hole.net/2017/02/22/what-really-happens-on-your-network-find-out-with-pi-hole/). So w…

> [@Angrynerd](#):
>
> Given that its only recieving requests from the router would any of those listed ip addresses actually affect anything?

Good question and I don't know the answer, because I see individual IP's in my Pi-hole. You can see individual IP's by (1) changing settings in your router if your router supports this, or (2) using the Pi-hole DHCP server.

> [@How do I use Pi-hole's built in DHCP server (and why would I want to)?](https://discourse.pi-hole.net/t/how-do-i-use-pi-holes-built-in-dhcp-server-and-why-would-i-want-to/3026):
>
> Using Your Existing Router For Network-wide Ad Blocking You might not need to use Pi-hole's DHCP server: In many home environments, your router also functions as your DHCP server. In this case, you can often [set Pi-hole to be the DNS server for your network clients in the router's DHCP (or LAN) settings page](https://discourse.pi-hole.net/t/how-do-i-configure-my-devices-to-use-pi-hole-as-their-dns-server/245), which allows all of your network clients to block ads simply by connecting to the network. Setting it up this way is also what makes Pi-hole very powerful for network-wide ad blocking. W…

---

<div class="post-metadata">

**Author:** ![Angrynerd](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/angrynerd/32/13693_2.png) [@Angrynerd](https://discourse.pi-hole.net/u/Angrynerd)\
**Post date:** [May 11, 2020, 5:10am UTC](https://discourse.pi-hole.net/t/groups-and-dhcp/31901/3 "2020-05-11T05:10:03Z")

</div>

Thank you for replying. For reference if not already obvious I have my router set to use pihole as the DNS server. This is why it't the only showing client. I guess at some point I will have to truely test if that makes a difference. when refering to group management. I dont have complicated setup that nessesitates it or anything it was more of just feature exploring. Have a great day!

---

<div class="post-metadata">

**Author:** ![DerekO](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dereko/32/3998_2.png) [@DerekO](https://discourse.pi-hole.net/u/DerekO)\
**Post date:** [May 11, 2020, 1:25pm UTC](https://discourse.pi-hole.net/t/groups-and-dhcp/31901/4 "2020-05-11T13:25:37Z")

</div>

Sorry to jump in on this one, but a further question...

Are Groups based solely on IP address, or on MAC address?

The reason I ask is that when a client connects and gets assigned an IP using DHCP, it could be a different IP than what the client was previously known as, so would the group definitions be aware of this?

e.g. First time I add my phone to the group it may have an IP of 192.168.1.10. The next time it may get assigned a different IP via DHCP - 192.168.1.20 - so is the group config updated to reflect this?

Thanks

---

<div class="post-metadata">

**Author:** ![Angrynerd](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/angrynerd/32/13693_2.png) [@Angrynerd](https://discourse.pi-hole.net/u/Angrynerd)\
**Post date:** [May 11, 2020, 1:38pm UTC](https://discourse.pi-hole.net/t/groups-and-dhcp/31901/6 "2020-05-11T13:38:37Z")

</div>

Hello, this is an interesting question. As far as i can tell it is based on ip as that is all that is configured when you ad a client in the clients section of group management. This doesn't make too much of a difference given that it can also assign static addresses. An implementation that uses MAC addresses instead could be very interesting for those who aren't using static addresses or for whatever reason cant assign them.

---

<div class="post-metadata">

**Author:** ![DL6ER](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dl6er/32/281_2.png) [@DL6ER](https://discourse.pi-hole.net/u/DL6ER)\
**Post date:** [May 11, 2020, 8:29pm UTC](https://discourse.pi-hole.net/t/groups-and-dhcp/31901/7 "2020-05-11T20:29:49Z")

</div>

> [@Angrynerd](#):
>
> Given that its only recieving requests from the router would any of those listed ip addresses actually affect anything?

No, the router sends the replies on behalf of your clients in this configuration. There is no possibility for Pi-hole to see who the original requestor was. Hence, they are one and the same client.

> [@DerekO](#):
>
> Are Groups based solely on IP address, or on MAC address?

IP address. DNS queries are asked using either the UDP or TCP protocols. Both use IP addresses for describing the source and destination of the packages. Hence, IP addresses are the only thing visible to the DNS server.

We can source hardware addresses (using other means) for devices not more than one hop away (this is what the network overview table does). It is not possible to get the hardware address for devices connected through routers, VPNs or other separations (like VLANs). Hence, hardware addresses don't seem suitable for this task.

We implement subnetting support (your client can be `192.168.3.0/24` to match all `192.168.3.1 - 192.168.3.254`). This allows a certain flexibility, e.g., other blocking rules in a "guests" network. This would be impossible with hardware addresses as identifiers.

> [@DerekO](#):
>
> First time I add my phone to the group it may have an IP of 192.168.1.10. The next time it may get assigned a different IP via DHCP - 192.168.1.20

From a technical point of view, I say: Your DHCP shouldn't do that. I know that many (esp. the cheaper) routers do such things. We call this non-deterministic. There isn't much we can so about it, the group management, currently, cannot auto-adapt, also, because often enough the devices are out of view. For instance, guest networks are often separated and their hardware addresses are not visible to Pi-hole.

However, we're open for discussions on improving Pi-hole if you have a good idea. We can maybe allow both: IP addresses (with possible CIDR modifier for subnet description) and hardware addresses. This will be complex and maybe even harder to explain to users.

---

<div class="post-metadata">

**Author:** ![Chris\_Anthony](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/chris_anthony/32/15001_2.png) [@Chris\_Anthony](https://discourse.pi-hole.net/u/Chris_Anthony)\
**Post date:** [May 13, 2020, 2:34pm UTC](https://discourse.pi-hole.net/t/groups-and-dhcp/31901/9 "2020-05-13T14:34:59Z")

</div>

What about in cases where the Pi-Hole is the DHCP server? Wouldn't then using a MAC address be the best option? If not, doesn't this mean we would need to set static IP addresses for those in the groups? Automatic IP's would get a different IP when the lease is up and then not be recognized by the group defeating its purpose.

Do I have to also add each IP the device is using? Instead why not by MAC or HOST name that the PI-Hole already knows so it can pull each IP address instead of manually adding each one and every time it also changes?

---

<div class="post-metadata">

**Author:** ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)\
**Post date:** [May 13, 2020, 3:13pm UTC](https://discourse.pi-hole.net/t/groups-and-dhcp/31901/10 "2020-05-13T15:13:39Z")

</div>

> [@Chris\_Anthony](#):
>
> What about in cases where the Pi-Hole is the DHCP server? Wouldn't then using a MAC address be the best option? If not, doesn't this mean we would need to set static IP addresses for those in the groups? Automatic IP's would get a different IP when the lease is up and then not be recognized by the group defeating its purpose.

Pihole is a deterministic DHCP - this means your clients should get the same IP every time the acquire a new lease.

---

<div class="post-metadata">

**Author:** ![DL6ER](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dl6er/32/281_2.png) [@DL6ER](https://discourse.pi-hole.net/u/DL6ER)\
**Post date:** [May 13, 2020, 5:38pm UTC](https://discourse.pi-hole.net/t/groups-and-dhcp/31901/11 "2020-05-13T17:38:31Z")

</div>

> [@Chris\_Anthony](#):
>
> Instead why not by MAC or HOST name that the PI-Hole already knows so it can pull each IP address instead of manually adding each one and every time it also changes?

We're working on this. It is not all that straightforward as it may seem, especially since MAC addresses are only visible in the immediate vicinity of your Pi-hole (it will not work across routers, VLANs, etc.).

You can monitor

> <https://github.com/pi-hole/FTL/pull/762>
>
> \*\*By submitting this pull request, I confirm the following:\*\*
> 
> \- \[X\] I have re…ad and understood the \[contributors guide\](https://github.com/pi-hole/pi-hole/blob/master/CONTRIBUTING.md).
> \- \[X\] I have checked that \[another pull request\](https://github.com/pi-hole/FTL/pulls) for this purpose does not exist.
> \- \[X\] I have considered, and confirmed that this submission will be valuable to others.
> \- \[X\] I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
> \- \[X\] I give this submission freely, and claim no ownership to its content.
> 
> \*\*How familiar are you with the codebase?:\*\* 
> 
> \## 10
> 
> \---
> 
> This PR teaches FTL how to use MAC addresses to automatically identify clients immediately connected you the Pi-hole. This will make the configuration for clients changing their addresses frequently (non-deterministic DHCP server, IPv6 privacy extension, non-constant ISP IPv6 prefixes, etc.) easier than before.
> 
> Defining clients by IP addresses (possibly an entire subnet with CIDR notation) stays intact.
> 
> It works the following way: If we didn't find an IP address match (either exact or subnet), we lookup the IP address within the Network overview table. If we find a (sufficiently recent) IP address match there, we extract the corresponding MAC address. We use this MAC address for a new lookup in the \`client\` database table to see if there is a client configured with this MAC address.

for our progress. Currently, it is still a feature draft, albeit a working one. If you (or anyone else) want to test it at any point, it would be appreciated.

---

<div class="post-metadata">

**Author:** ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)\
**Post date:** [May 13, 2020, 8:25pm UTC](https://discourse.pi-hole.net/t/groups-and-dhcp/31901/12 "2020-05-13T20:25:22Z")

</div>

Didn't know where else to put it:

> [@Feedback for "Allow defining clients by their MAC address, host name and networking interface"](https://discourse.pi-hole.net/t/feedback-for-allow-defining-clients-by-their-mac-address/32324):
>
> Started this topic to provide feedback to the new feature allowing clients to be defined by MAC address. I switched to the branches (core still master) by pihole checkout ftl new/mac\_clients pihole checkout web new/mac\_clients And flushed network table afterwards. Important First thing I noticed in Group management/Clients Known Clients now only contain clients with known MAC, no IPs are listed anymore (I have devices on other Vlans so IP would still be handy). [Bildschirmfoto zu 2020-05…
