DHCP server setup
Advanced Configuration
A DHCP (Dynamic Host Configuration Protocol) server automatically assigns IP addresses and network settings to devices on a network, enabling them to communicate with each other and access the internet.
Benefits of Using Pi-hole as Your DHCP Server
Enhanced Ad Blocking
Pi-hole's DHCP server automatically sets itself as the DNS server for all devices, providing comprehensive ad blocking and tracking prevention without requiring manual DNS configuration on each device.
Advanced DNS Management
You can configure custom DNS settings through Pi-hole, enabling features like local hostname resolution and domain-specific blocking.
Improved Device Management
Pi-hole can assign recognizable names to devices, making its web interface more user-friendly and informative. The system also simplifies static IP address assignment through its intuitive interface.
Centralized Control
Managing all network-related settings, including DNS and IP assignments, from a single interface reduces complexity and eliminates dependence on router or modem capabilities.
Router Independence
If your router offers limited or outdated DHCP features, Pi-hole can provide greater flexibility and control over your network settings.
Important Considerations
Before switching to Pi-hole as your DHCP server, keep in mind:
- You must disable your router or modem's DHCP server to prevent IP address conflicts
- Pi-hole needs to maintain constant uptime to ensure reliable network operation
Setting Up DHCP Server on Pi-hole
Prerequisites
- Pi-hole installed and running
- Admin access to your Pi-hole interface
- Admin access to your router
- Physical or SSH access to your Pi-hole device
Step 1: Disable Router DHCP
- Log into your router's admin interface
- Locate DHCP settings (usually under LAN or Network settings)
- Disable DHCP server
- Save changes
Note: Do NOT disconnect from your router yet - keep your session active in case you need to revert changes.
Step 2: Enable DHCP in Pi-hole
- Access Pi-hole admin interface (http://pi.hole/admin or your Pi-hole's IP address)
- Navigate to Settings > DHCP
- Check "DHCP server enabled"
- Configure DHCP settings:
- Range of IP addresses to hand out (e.g., 192.168.1.50 to 192.168.1.250)
- Router (gateway) IP address
- Local domain name (optional)
- Enable IPv6 support (if needed)
- Click Save
Step 3: Configure DHCP Options (Optional)
- Set static IP reservations for specific devices
- Configure DHCP lease time
- Set up conditional forwarding if needed
Step 4: Verify DHCP Operation
- Disconnect and reconnect a device to your network
- Verify it receives an IP address from Pi-hole
- Check Pi-hole's DHCP leases page to confirm
- Test internet connectivity
- Verify DNS blocking is working
Troubleshooting
No IP Address Assigned
- Verify router's DHCP is disabled
- Check Pi-hole DHCP service status:
bash sudo service pihole-FTL status - Verify IP range doesn't conflict with router
- Check network connectivity to Pi-hole
Can't Access Internet
- Verify gateway IP is correct
- Check DNS settings
- Ping gateway to verify connectivity:
bash ping 192.168.1.1
Static IP Conflicts
- Review DHCP lease table
- Check for duplicate IP assignments
- Clear DHCP leases if necessary:
bash sudo rm /etc/dnsmasq.d/04-pihole-static-dhcp.conf sudo service pihole-FTL restart
Best Practices
- Keep Pi-hole on a static IP address
- Set up a backup DHCP server if possible
- Document your network configuration
- Regularly backup Pi-hole settings
- Monitor DHCP lease capacity
Recovery Plan
If DHCP setup fails:
- Keep router admin session open
- Re-enable router DHCP if needed
- Document any error messages
- Check Pi-hole logs:
bash sudo cat /var/log/pihole-FTL.log
Something here not working for you? Ask in the community — other makers and the Little Bird team read it.