DHCP and dnsmasq config

I tested DHCP services on pihole, and they work, but the php/web interface does not support the full gamut of dnsmasq specification capabilities. I will tell you right out, that I have zero php experience, and I tried to modify the php to do what I wanted to add, and I'll I did was break the web interface.

When I hand edit the dnsmasq config, it would do what I wanted, but that broke the web interface as far as formatting and information display.

I am running pihole installed on RaspberryPi OS on 3B+ plus unbound for recursive DNS

It is a fully stock install, maintained via 'pihole -up'
I have reverted my php changes.

One of the things I do now is run a separate dnsmasq on a separate 3B+.
On that install, I use dnsmasq options such as multiple MAC addresses on a single line mapped to a single IP address. I do this for multiple Eth hosts where only one will be plugged in looking for an address.
I know that is a corner case, but it works under dnsmasq (raw on the 3B+) and it also works under the dnsmasq running on pihole. It is just that it breaks the pihole web interface.

Also, the web interface doesn't currently support specifying the lease time, but dnsmasq under pihole supports it.

I am considering just removing the web interface from pihole, other than then DHCP "Enable" checkbox, for my local install.

Thanks for supporting such an awesome project, this is a really piddling issue, I wouldn't even call it a complaint.

[Edit] I might be complaining if I wasn't so comfortable with raw dnsmasq config. I was happy that pihole allowed my custom settings, I was more concerned with the web interface messing with my custom settings, or borking normal pihole operation when it encountered my custom configuration. That is why I reverted back to my existing dnsmasq server.

The web interface allows to configure lease time

Also in a .conf file under /etc/dnsmasq.d it can be configured via
dhcp-option=51,xxxxx where xxxx is in seconds for the lease time

I also use other DHCP parameters in a .conf file and none of them conflicts with the pihole web interface. I agree DHCP options in dnsmasq is great, much flexible and rich than an ordinary home router settings.

1 Like

Just curious on the config file naming hierarchy. I was considering the same idea, but I wasn't sure what where reserved names or how it would be parsed.
Is that documented (other than via code)? I could go back and read the PHP and see if I can find that.
If it will ignore my custom stuff, that would be awesome.

I should probably mention that I am doing some highly unorthodox stuff with dnsmasq, sharing the dhcp for my full network with a test lab in my basement. I have some equipment that I switch around the address assignments to test udhcpcd behavior in OpenWRT.

As far as I know, dnsmasq reads all the .conf files under /etc/dnsmasq.d folder in an alphabetic order, that's why it is traditional to name those files aa-xxx.conf, bb-yyyy.conf etc. I have the following files on my folder, all processed by dnasmaq (some are standard pihole .conf files, created on pihole install or written when you change a setting in GUI) I use 30, 31,... and so on to be sure, they are not pihole created files