Running your own DHCP server gives you full control over IP address assignment, DNS resolution, and network boot operations. Whether you manage a homelab with dozens of devices or an enterprise network spanning multiple VLANs, choosing the right DHCP server is one of the most foundational decisions you’ll make.
In this guide, we compare the three most popular open-source DHCP servers — Kea, Dnsmasq, and the legacy ISC DHCP — with hands-on installation instructions, docker Compose configurations, and production-ready deployment advice.
Why Run Your Own DHCP Server?
Most home users rely on the DHCP server baked into their consumer router. That works fine for a handful of devices on a single flat network. But as soon as your infrastructure grows, the limitations become obvious:
- VLAN segmentation — Consumer routers can’t assign addresses across multiple subnets. A dedicated DHCP server handles VLANs and subnet scopes with ease.
- Static reservations — Lock specific MAC addresses to fixed IPs so your servers, NAS, and pi-hole always get the same address without manual static IP configuration on each device.
- DNS integration — DHCP and DNS are natural partners. Servers like Dnsmasq handle both, ensuring every device that receives a lease is automatically registered in DNS.
- Network boot (PXE/TFTP) — Provision bare-metal servers, diskless workstations, or thin clients by serving boot images over the network.
- Lease monitoring and auditing — Track every device that connects to your network, when it connected, and what IP it received. Built-in router logs rarely expose this data.
- High availability — Consumer routers are single points of failure. Open-source DHCP servers support failover pairs and load-balanced clusters.
- Custom DHCP options — Push custom options (NTP servers, SIP proxies, vendor-specific settings) to clients on a per-subnet basis.
If any of these sound useful, it’s time to take DHCP into your own hands.
The Contenders at a Glance
Before diving into configuration, here’s how the three major options compare:
| Feature | Kea | Dnsmasq | ISC DHCP |
|---|---|---|---|
| Status | Actively developed (ISC successor) | Actively developed | End-of-life (EOL June 2022) |
| Protocols | DHCPv4, DHCPv6 | DHCPv4, DNS, TFTP, PXE | DHCPv4, DHCPv6 |
| Backend | MySQL, PostgreSQL, Cassandra, memfile | In-memory, hosts file | Flat file (leases) |
| HA Support | Yes (failover + load balancing) | No (single instance) | Yes (failover protocol) |
| Configuration | JSON | Simple flat file | Complex flat file |
| REST API | Yes (control agent) | No | No |
| Hook System | Yes (C/C++ and Python plugins) | No | Limited |
| Resource Usage | Moderate (backend-dependent) | Very low | Low |
| Best For | Enterprise, multi-VLAN, automation | Homelabs, small networks, DNS combo | Legacy deployments (migration target) |
| License | MPL 2.0 | GPL v2/v3 | ISC License |
Which One Should You Choose?
- Homelab / small office — Dnsmasq. It’s lightweight, combines DHCP with DNS in one process, and takes minutes to configure.
- Enterprise / multi-VLAN — Kea. It’s ISC’s modern successor with database backends, REST API, high-availability clustering, and a plugin architecture.
- ISC DHCP — Only if you’re maintaining legacy infrastructure. ISC officially ended support in June 2022. Migrate to Kea at your earliest convenience; the configuration migration tool handles most of the conversion automatically.
Kea DHCP: The Modern Enterprise Choice
Kea is ISC’s next-generation DHCP server, designed from the ground up to replace ISC DHCP. It supports DHCPv4, DHCPv6, a RESTful management API, database-backed lease storage, and high-availability clustering.
Installation on Ubuntu/Debian
| |
Core Configuration
Kea uses JSON configuration files. The main DHCPv4 config lives at /etc/kea/kea-dhcp4.conf:
| |
This configuration defines two subnets (a main network and a VLAN), sets up two static reservations, pushes DNS/NTP/router options, and logs to a file with rotation.
Setting Up the MySQL Backend
| |
Running Kea in Docker
| |
Note that the DHCP container uses network_mode: "host" because DHCP operates at layer 2 and requires direct access to the network interface.
Using the REST API
Kea’s control agent exposes a REST API for runtime management:
| |
High-Availability Cluster
Kea supports active-passive and load-balanced HA pairs. Add this to your config:
| |
Dnsmasq: The Lightweight Homelab Champion
Dnsmasq is a lightweight, combined DNS forwarder and DHCP server. It’s the go-to choice for homelabs because a single binary handles both services, uses minimal resources, and ships with a straightforward configuration file. It’s also the DNS/DHCP engine behind Pi-hole.
Installation on Ubuntu/Debian
| |
On Alpine Linux (great for containerized deployments):
| |
Core Configuration
Edit /etc/dnsmasq.conf:
| |
Managing the Service
| |
Running Dnsmasq in Docker
| |
The Docker image reads the config from /etc/dnsmasq.conf. Create a companion dnsmasq.hosts file for local DNS:
| |
Multi-VLAN Configuration
Dnsmasq supports multiple interfaces and subnet ranges in a single instance:
| |
PXE Network Boot Setup
Dnsmasq can serve as a full PXE boot server:
| |
Place your boot images in /srv/tftp/ and devices will boot over the network automatically.
ISC DHCP: The Legacy Option (Migration Guide)
ISC DHCP served as the internet’s standard DHCP server for over two decades. However, ISC officially declared end-of-life in June 2022. No new features or security patches are being developed. If you’re still running ISC DHCP, you should plan a migration to Kea.
Why Migrate?
- No security patches — New vulnerabilities will not be fixed.
- No DHCPv6 improvements — Kea’s DHCPv6 implementation is far more mature.
- No REST API — ISC DHCP has no programmatic management interface.
- File-based leases — Kea’s database backends handle millions of leases efficiently.
Migration Steps
ISC provides a migration tool. Here’s the process:
| |
ISC DHCP Reference Configuration
For those still running ISC DHCP during migration, here’s a reference config (/etc/dhcp/dhcpd.conf):
| |
Advanced: DHCP Snooping and Security
Running your own DHCP server opens up security considerations that consumer routers simply don’t address.
Preventing Rogue DHCP Servers
A rogue DHCP server on your network can redirect traffic, perform man-in-the-middle attacks, or simply cause network outages. Enable DHCP snooping on your managed switches:
| |
On Linux bridges, use ebtables to drop DHCP packets from unauthorized MAC addresses:
| |
DHCP Lease Monitoring Script
Monitor your DHCP leases and alert on new unknown devices:
| |
Run this via cron every 5 minutes:
| |
Decision Matrix
Choose based on your specific needs:
| Your Situation | Recommendation |
|---|---|
| Single network, under 50 devices | Dnsmasq |
| Multiple VLANs, under 200 devices | Dnsmasq (multi-interface) or Kea |
| Enterprise network, 500+ devices | Kea with MySQL/PostgreSQL backend |
| Need DHCP + DNS in one package | Dnsmasq |
| Need REST API and automation | Kea |
| Need high availability | Kea (HA clustering) |
| PXE boot / network installation | Dnsmasq (built-in TFTP) or Kea |
| Migrating from ISC DHCP | Kea (official migration path) |
| Running on a Raspberry Pi | Dnsmasq (minimal resource usage) |
| Kubernetes environment | Kea (database backend, API-driven) |
Final Recommendations
For most homelab users, Dnsmasq is the right choice. It’s been battle-tested for over two decades, uses less than 5 MB of RAM, and gives you both DHCP and DNS in a single process. The configuration file is intuitive — you can have a fully functional DHCP server running in under five minutes.
For production and enterprise environments, Kea is the clear winner. Its database backends handle millions of leases, the REST API enables infrastructure-as-code workflows, and the HA clustering ensures your network never loses DHCP service during maintenance. The JSON configuration has a learning curve, but the payoff in operational flexibility is substantial.
For ISC DHCP users, there’s no reason to stay on an unsupported product. Kea was designed as its direct successor, and the migration tools make the transition straightforward. Plan your migration, test thoroughly in a staging environment, and cut over during a maintenance window.
Whichever you choose, running your own DHCP server is one of the highest-leverage infrastructure decisions you can make. It gives you visibility into every device on your network, eliminates dependency on proprietary router firmware, and lays the foundation for everything else — DNS, PXE boot, VLAN segmentation, and network automation.
Frequently Asked Questions (FAQ)
Which one should I choose in 2026?
The best choice depends on your specific requirements:
- For beginners: Start with the simplest option that covers your core use case
- For production: Choose the solution with the most active community and documentation
- For teams: Look for collaboration features and user management
- For privacy: Prefer fully open-source, self-hosted options with no telemetry
Refer to the comparison table above for detailed feature breakdowns.
Can I migrate between these tools?
Most tools support data import/export. Always:
- Backup your current data
- Test the migration on a staging environment
- Check official migration guides in the documentation
Are there free versions available?
All tools in this guide offer free, open-source editions. Some also provide paid plans with additional features, priority support, or managed hosting.
How do I get started?
- Review the comparison table to identify your requirements
- Visit the official documentation (links provided above)
- Start with a Docker Compose setup for easy testing
- Join the community forums for troubleshooting