PiHoleHQ
Isometric gray enclosure holding a green Raspberry Pi-style board with Ethernet ports on a dotted purple pad, a Pi-hole DHCP server setup.
configuration

Pi-hole DHCP Server Setup Guide (v6, Step by Step)

Set up the Pi-hole v6 DHCP server, switch off router DHCP, add reservations, and verify client leases and DNS, including on Verizon Fios.

By PiHoleHQ Editorial · ·Updated · 7 min read

Give the Pi-hole host a static IP, disable DHCP on your router, then enable the DHCP server in Pi-hole v6. Set the address pool and keep the router’s LAN address as the gateway. Renew a client lease and check that Pi-hole supplied both the lease and DNS. Pi-hole post-install guide · FTL configuration reference

Should Pi-hole run DHCP on your network?

If your router can advertise Pi-hole as the DNS server for LAN clients, you can keep DHCP on the router. That setting is called DHCP option 6. Switch to Pi-hole DHCP if the router cannot advertise your chosen DNS server or you want to manage named reservations in Pi-hole. Pi-hole post-install guide · RFC 2132, section 3.8 · Pi-hole DHCP FAQ

If you use pfSense, see Pi-hole vs pfSense pfBlockerNG.

Plan the addresses

Record the router’s DHCP range, active leases, lease time and reservations before cutover. This example keeps the gateway, Pi-hole host and reserved addresses outside the dynamic pool. Use addresses from your own LAN and check for existing assignments before choosing them. dnsmasq manual

Setting Example
LAN subnet 192.168.1.0/24
Netmask 255.255.255.0
Gateway (router) 192.168.1.1
Static IP on the Pi-hole host 192.168.1.53
Reservations NAS at 192.168.1.20, printer at 192.168.1.21
Dynamic pool 192.168.1.100–192.168.1.199
Lease time 24h

Clients normally first try to renew with the server that issued the lease. If that server stays silent, the client later broadcasts a request that another server can answer. Renew a client immediately after cutover to check the new setup without waiting for it to rebind. RFC 2131, section 4.4.5

Set a static IP on the Pi-hole host

Set the IP in the host’s network configuration before switching off the router’s DHCP server. If you installed Pi-hole using the Raspberry Pi setup guide, check whether its existing address comes from a router reservation. That reservation depends on the router’s DHCP service. Pi-hole prerequisites · Pi-hole post-install guide

On a Linux host that uses NetworkManager, run the example from a local console because reactivating the profile can interrupt a remote session. Replace Wired connection 1 with the active profile name and DNS_IP with a working DNS server independent of this Pi-hole. This keeps DNS available on the host if Pi-hole needs repair. Red Hat guide to configuring Ethernet with nmcli · NetworkManager nmcli reference · Pi-hole post-install guide

nmcli connection show --active
sudo nmcli connection modify "Wired connection 1" ipv4.method manual ipv4.addresses 192.168.1.53/24 ipv4.gateway 192.168.1.1 ipv4.dns DNS_IP
sudo nmcli connection up "Wired connection 1"

If the host has a firewall, allow DHCPv4 requests on UDP port 67 from the LAN interface. Pi-hole prerequisites

Turn off DHCP on the router

Disable the router’s LAN DHCPv4 server and leave the router itself online as the gateway. Pi-hole sets dnsmasq to authoritative DHCP mode, which assumes it is the only DHCP server on that network. Pi-hole post-install guide · FTL configuration generator · dnsmasq manual

Run discovery on the Pi-hole host. If another server still answers on the LAN you are moving, identify and disable it before continuing. Pi-hole FTL DHCP discovery command

sudo pihole-FTL dhcp-discover

Enable Pi-hole’s DHCP server

In Pi-hole’s web interface, open Settings > DHCP. Toggle Basic at the top right to enter Expert mode and reveal Advanced DHCP Settings. Select DHCP server enabled, enter the range, router, netmask and lease time from the table, then click Save & Apply. Pi-hole Expert mode instructions · Pi-hole DHCP screen source

The CLI equivalent sets the same values and enables the server last. FTL configuration reference

sudo pihole-FTL --config dhcp.start "192.168.1.100"
sudo pihole-FTL --config dhcp.end "192.168.1.199"
sudo pihole-FTL --config dhcp.router "192.168.1.1"
sudo pihole-FTL --config dhcp.netmask "255.255.255.0"
sudo pihole-FTL --config dhcp.leaseTime "24h"
sudo pihole-FTL --config dhcp.active true
  • dhcp.router is the default gateway clients receive. Use your router’s LAN IP.
  • dhcp.netmask can be left blank on a directly connected LAN so Pi-hole can infer the mask from its interface. For a network using a DHCP relay, set the mask explicitly.
  • dhcp.leaseTime defaults to one hour for IPv4 and one day for IPv6 when left blank.
  • dhcp.multiDNS advertises Pi-hole’s DNS address multiple times. Some clients add proprietary DNS servers, which can bypass Pi-hole. Repeating Pi-hole’s address is intended to prevent those additions.

These settings are defined in the FTL configuration reference. Leave dhcp.rapidCommit off for this setup. It enables a two-message exchange with additional requirements for networks with multiple servers. RFC 4039

Add reservations

In Expert mode, open Static DHCP configuration on the DHCP page. In Advanced Settings, enter one row per device with its MAC address, reserved IP, hostname and lease time. Click Save & Apply. Keep each reserved address in the LAN subnet. Pi-hole DHCP screen source

The CLI command below sets the entire dhcp.hosts list. Include any existing entries you want to keep, and substitute the MAC addresses of your own devices. FTL configuration reference

sudo pihole-FTL --config dhcp.hosts '["00:20:e0:3b:13:af,192.168.1.20,nas,24h","00:20:e0:ab:cd:ef,192.168.1.21,printer,24h"]'

dhcp.ignoreUnknownClients makes Pi-hole serve only clients listed in dhcp.hosts. Devices can still assign themselves an address, so this setting provides no access control. FTL configuration reference

Renew client leases and verify

Run DHCP discovery again. On the example LAN, the only expected DHCP server is 192.168.1.53. Renew from a client on that LAN and check the result before moving on to other devices. Pi-hole FTL DHCP discovery command

  • Windows. In a local Command Prompt, use ipconfig to find the adapter name. Run ipconfig /release "Ethernet", then ipconfig /renew "Ethernet", substituting your adapter name. Run ipconfig /all to check the DHCP server, IPv4 DNS server and default gateway. Microsoft ipconfig reference
  • macOS. Go to System Settings > Network, select the network service and click Details. Open TCP/IP, click Renew DHCP Lease, then click OK. Apple’s DHCP lease renewal guide
  • Linux with NetworkManager. At a local console, find the client profile using nmcli connection show --active. Run sudo nmcli connection down "Wired connection 1", then sudo nmcli connection up "Wired connection 1", replacing the profile name in both commands. Run nmcli device show to inspect the active device’s IPv4 details. NetworkManager nmcli reference

For this example, the client should receive a pool address or its reservation, use 192.168.1.1 as the IPv4 gateway and use 192.168.1.53 for DHCP and IPv4 DNS. Confirm the device is listed under Currently active DHCP leases. For more detail, turn on dhcp.logging and view the log with pihole tail. Pi-hole DHCP screen source · FTL configuration reference · Pi-hole command reference

After the NAS has leased its reserved address, check forward and reverse DNS directly against Pi-hole. This example uses lan, the default local suffix in dns.domain.name. The first result should be 192.168.1.20 and the second should identify the NAS by name. FTL configuration reference · dnsmasq manual · BIND dig manual

dig @192.168.1.53 nas.lan +short
dig @192.168.1.53 -x 192.168.1.20 +short

If blocking still looks partial, see why Pi-hole is not blocking ads.

Pi-hole DHCP with a Verizon Fios router

For a Fios G3100, keep the router as the default gateway and switch its LAN DHCP off before enabling Pi-hole DHCP. If you also use an E3200 extender, check its lease and connectivity after the switch. A G3100/E3200 owner reported repeated DHCP requests and intermittent connectivity on the extender after moving DHCP to Pi-hole. If your extender loses connectivity, use the rollback below. G3100/E3200 owner report on Pi-hole Userspace

What changes with IPv6 and VLANs?

The start and end addresses above define an IPv4 pool. Pi-hole’s separate Enable additional IPv6 support (SLAAC + RA) setting uses stateless DHCPv6 with router advertisements. Clients can configure their own IPv6 addresses using SLAAC and obtain DNS details via DHCPv6. Pi-hole DHCP screen source · FTL configuration generator · dnsmasq manual

For a VLAN where Pi-hole has no interface, configure a DHCP relay on the VLAN’s router and point it at Pi-hole. Set the netmask and the gateway for that VLAN in its range configuration. This example gives VLAN 30 its own range and tags those leases so they receive the VLAN’s gateway. RFC 2131 · dnsmasq manual

# /etc/dnsmasq.d/10-vlan30.conf
dhcp-range=set:iot,192.168.30.100,192.168.30.199,255.255.255.0,24h
dhcp-option=tag:iot,option:router,192.168.30.1

Enable misc.etc_dnsmasq_d to load the file. A malformed file can stop DNS resolution. On a systemd host, restart FTL with sudo systemctl restart pihole-FTL.service. Renew from the VLAN and test DNS separately because the default LOCAL listening mode accepts DNS only from subnets where Pi-hole has an interface. FTL configuration reference · Pi-hole service restart example

How do I switch back to the router’s DHCP server?

Run sudo pihole-FTL --config dhcp.active false, then re-enable the router’s DHCP server with its previous range and reservations. Renew a client lease and check that the router now supplies it. FTL configuration reference · Pi-hole post-install guide

Does Pi-hole DHCP work in Docker?

Yes. Use host networking, a macvlan network that gives the container its own LAN IP, or a bridge network with a DHCP relay. The official Compose example calls for the NET_ADMIN capability for DHCP. With bridge networking and a relay, publish UDP port 67 using the example’s 67:67/udp mapping. Pi-hole Docker DHCP guide · Official Pi-hole Compose example

Evidence note. The setup is based on the Pi-hole v6 FTL reference and web interface source. No hands-on testing was performed. FTL configuration reference · Pi-hole DHCP screen source

Sources

  1. Pi-hole post-install guide
  2. FTL configuration reference
  3. RFC 2132, section 3.8
  4. Pi-hole DHCP FAQ
  5. dnsmasq manual
  6. RFC 2131, section 4.4.5
  7. Pi-hole prerequisites
  8. Red Hat guide to configuring Ethernet with nmcli
  9. NetworkManager nmcli reference
  10. FTL configuration generator
  11. Pi-hole FTL DHCP discovery command
  12. Pi-hole Expert mode instructions
  13. Pi-hole DHCP screen source
  14. RFC 4039
  15. Microsoft ipconfig reference
  16. Apple's DHCP lease renewal guide
  17. Pi-hole command reference
  18. BIND dig manual
  19. G3100/E3200 owner report on Pi-hole Userspace
  20. Pi-hole service restart example
  21. Pi-hole Docker DHCP guide
  22. Official Pi-hole Compose example

Related