Extra DHCP Server Options


I use Pi-hole on my rpi3 to serve DHCP for multiple networks. I have these networks:

MGMT - vlan 1 -
LAN - vlan 10 -
GUEST - vlan 20 -
DMZ - vlan 30 -
DNS - vlan 40 - (this is where Pi-hole is)

I have a DHCP relay agent on my router which forwards DHCP requests from VLANs 1, 10, 20, and 30 over to the Pi-hole in VLAN40. This works perfectly. I also have a /etc/dnsmasq.d/dnsmasq.conf file that has the relevant DHCP scopes and static DHCP leases defined. This works fine also.

What doesn’t work is any of the DHCP functionality in the Pi-hole GUI. I’d love to be able to tweak / configure the DHCP scopes and static leases from the GUI but there’s several things preventing me from doing so:

  1. When enabling the DHCP server on Pi-hole (in general) it fails to specify the subnet mask. This causes dnsmasq to default to classful (class a, b, c) subnet masks. This breaks things, badly, because it gives out /16 subnet masks for 192.168.x.x addresses. This isn’t a problem for most small networks where there’s only one subnet, but it completely breaks when multiple vlans are in play. Pi-hole should, at the very least, default to a sane value (/24), and provide an option in the GUI to adjust this.

  2. Pi-hole GUI only supports one DHCP scope. It’d be great to have an option to define multiple scopes, with different gateways.



I do the same thing, and while configuring it in dnsmasq.conf was simple, a tear leaks from my right eye every time I view the dhcp portion of the GUI. It would definitely be nice to allow multiple VLANs on the gui itself.


You can quasi-use the GUI if you’re ok with manually editing the settings.php file. Details:

In “/var/www/html/admin/settings.php”, on line 473, change “if ($DHCP) {” to “if (true) {”. This will enable the leases section of the DHCP GUI. Then, put your static DHCP entries, if you have any, in:


Then, store your dhcp.lease file in /etc/pihole/dhcp.leases. I use this line in my dnsmasq.conf file:

This will allow you to see any static reservations you have configured, and, it will also display the current leases.


@networknerd Can you post an example of your /etc/dnsmasq.d/dnsmasq.conf file? I am trying to get this going to my network as well.

vlan 10/lan:
vlan 20/wlan:
vlan 30/iot: