Yes.
A DHCP server may hand out IPv4 addresses from its DHCP range or -for specific identifiable clients- from its DHCP lease reservations .
Technically, nothing prevents a DHCP server to run on a system that acquires its IPv4 address via DHCP.
Your router would be a prime example for that: It acquires its public IPv4 from one of your ISP's DHCP servers while acting as a DHCP server for your private network at the same time (however, note that this is a slightly different use case, as multiple network interfaces and networks are involved).
It would depend whether that would work in a given configuration (click for details)
A machine will broadcast for a DHCP server to acquire an IPv4 address, and a DHCP server has to provide its own source IP address.
If Pi-hole is the only DHCP server on the link, it may not been up yet during that initial broadcast. Without a reply, the machine would assign itself a link-local IPv4 address (range 169.254.0.0/16
).
It would then depend on both the DHCP server as well as the DHCP client software whether a broadcast would be repeated at a later time and whether that would work when only a link-local IPv4 address is available.
If another DHCP server would be active on the same link, the DHCP client on Pi-hole's host could acquire its IPv4 by a DHCP lease through that other DHCP server.
This may be an option, e.g. if you cannot switch off your DHCP server on your router: Limit your router's DHCP range to just accomodate your Pi-hole host machine's IP(s), and configure your router's DHCP for fixed IP addresses / DHCP lease reservations for Pi-hole.
If you do not limit your router's DHCP range and don't configure DHCP lease reservations, your Pi-hole host machine may pick up different random IP addresses during reboot.
By setting a static IP address on-device, you would avoid all of the above potential issues.
The one disadvantage of setting a static IP on-device would only occur if you'd change your router:
If your new router configures a different subnet (e.g. 192.168.1.0/24
vs. 192.168.178.0/24
), you wouldn't be able to access your Pi-hole host anymore.
For headless Pi-hole systems, this would also mean you may not be able to reconfigure it for the new network once the new router is active. You'd either had to do so before installing the new router, or you'd have to configure your new router for the existing subnet. Note that not all routers may allow you to do so.
That said, setting a static IP on-device would be the preferred approach.