Where are the actual dnsmasq config files

So I upgraded to 5.1 on my secondary pihole. Wondering if I can continue to use the normal dnsmasq conf files. I have no interest in a fancy database or API to FTL or any other alphabet soup. Just the conf files, just basic bash script manipulation.

Here's what I've been doing.
Get the IP and host names from the primary pihole dnsmasq DHCP file.
Send it to the secondary.
Add 2 options to the dnsmasq conf file on the secondary.
Restart secondary dnsmasq service.
Make sure secondary DNS server is listed in DHCP server conf. (dhcp-option=6,0.0.0.0,10.123.123.123)
Restart dnsmasq service.

So if I put conf files in /etc/dnsmasq.d will they be used?

Where is the DHCP conf file?

I have not upgraded my primary pihole because I want to make sure these basic things work.

1 Like

Note that configuration of Pi-hole's FTL DNS engine (an optimised embedded dnsmasq version) is only a part of Pi-hole's configuration.
Management of blocklists, group assignments for client-specific filtering, individual domains allowed or denied by exact or regex matches, and UI settings are not handled by dnsmasq in any way.

Pi-hole uses configuration files in /etc/dnsmasq.d/.
It will read and process any configuration file in that directory, its own as well as any user provided.

Pi-hole itself will create the following files:
01-pihole.conf configures Pi-hole's DNS
02-pihole-dhcp.conf configures Pi-hole’s DHCP
04-pihole-static-dhcp.conf static DHCP leases

When editing these, note that Pi-hole will routinely overwrite these files on updates or UI interactions.
When extending Pi-hole's dnsmasq configuration by providing your own additional files, make sure they won't conflict with Pi-hole's configuration.

You'll find leases at /etc/pihole/dhcp.leases by default (as configured by 02-pihole-dhcp.conf). When copying information to a second machine, I wouldn't touch this leases file.

And if you intend to run multiple DHCP servers on your network, make sure that their DHCP IP address ranges do not overlap.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.