How to Use Pi-hole as Your DHCP Server (Fix Hostnames, Reservations and the Router's Limits)

Pi-hole (tutorial 34) works with the router handing out addresses. But two things nag: the query log shows every client as the router (because the router forwards DNS), or shows IPs with no names; and the router's DHCP page is where reservations live, which on ISP routers is clumsy or missing. Turn the router's DHCP off and let Pi-hole do it: every device then asks Pi-hole directly, gets a name in the log, and reservations and local DNS live in one screen.
Quick reference
| Step | What |
|---|---|
| Pi-hole needs | ports 67/udp (DHCP) reachable; host networking or macvlan in Docker |
| Enable | Pi-hole Settings → DHCP → enabled, range, gateway, lease time |
| Router | disable its DHCP server (not the router itself) |
| Reservations | Pi-hole DHCP → Static DHCP leases (MAC → IP → hostname) |
| Check | a device reconnects and nslookup laptop.lan works |
| If Pi-hole dies | devices keep leases until expiry; keep a router fallback plan |
1. Make sure Pi-hole can see broadcasts
DHCP is broadcast-based. A Pi-hole container on Docker's default bridge can't receive broadcasts; it must use host networking or a macvlan address (tutorial 101). In the Pi-hole compose file:
network_mode: host
cap_add:
- NET_ADMIN
(With host networking, port 53 and 80 clash with anything else on the host using them — tutorial 34's DNSStubListener note, and move Nginx off 80 or keep Pi-hole's web port on 8053 via FTLCONF_webserver_port.)
docker compose up -d
sudo ufw allow 67/udp
2. Configure DHCP in Pi-hole
Settings → DHCP:
- DHCP server enabled: tick.
- Range: 192.168.1.100 to 192.168.1.200 (leave room below for static devices).
- Router (gateway): 192.168.1.1.
- Lease time: 24 hours.
- Domain name: lan — devices become laptop.lan.
- Enable IPv6 support (SLAAC + RA): only if you've done tutorial 145.
Save. Pi-hole is now also offering leases — two DHCP servers at once is a race, so do the next step immediately.
3. Turn the router's DHCP off
Router admin → LAN / DHCP settings → disable DHCP server. (Not Wi-Fi, not the router — just address handing.) Save. Some routers reboot.
Devices keep their current leases and pick up Pi-hole's on renewal; no reconnection needed. Force one to check: toggle Wi-Fi on a phone, then Settings → DHCP → Currently active leases shows it with its name.
4. Reservations and names
Settings → DHCP → Static DHCP leases: MAC, IP, hostname. Move your reservations here from the router (server, printer, cameras, the Pi). From then on the Query log shows sarahs-phone instead of 192.168.1.137, and ping printer.lan works from any device.
Local DNS records (tutorial 34) and DHCP hostnames both resolve; homeserver.lan and cloud.home.example.com can point at the same box.
5. What happens if the server goes down
Devices with a lease carry on until it expires (24 hours above). After that, new connections fail to get an address — the house's network is down, not just the ads. Mitigations, pick one:
- Keep the lease time long (24–72 h) so a reboot or a short outage passes unnoticed.
- A second Pi-hole on a Pi with keepalived failover (tutorial 158) — the proper answer.
- Know how to switch back: re-enable the router's DHCP in two clicks. Write it in BookStack (88).
6. Docker macvlan instead of host networking
If host networking is awkward (ports), give the Pi-hole container its own LAN IP with a macvlan network (tutorial 101, step 5). DHCP broadcasts reach it, and port 80 can be Pi-hole's own. The host can't reach that IP directly — use another device to test.
Troubleshooting
Devices get no address. Pi-hole can't see broadcasts (bridge networking), or 67/udp blocked, or the router's DHCP is still on and winning.
Two different IPs for one device. Both DHCP servers ran briefly; wait for leases to expire, or reboot the device.
Query log still shows the router as the client. The router is still set as devices' DNS; Pi-hole's DHCP hands itself out as DNS — reconnect the device, or check the DHCP DNS setting isn't overridden.
.lan names don't resolve from the server itself. The server's own DNS should point at Pi-hole: resolvectl status, or nameserver 127.0.0.1 in /etc/resolv.conf.
Wrapping up
Host networking or macvlan, DHCP on in Pi-hole, DHCP off on the router, reservations moved across. Names in the query log, reservations and local DNS in one screen, and a router reduced to what it's good at. Lengthen the leases and plan a fallback, because you've just made the server the heart of the network.
