Where Is the dnsmasq Config File on Linux?
dnsmasq reads /etc/dnsmasq.conf on Linux, with drop-in snippets in /etc/dnsmasq.d.
Last updated
dnsmasq centers on /etc/dnsmasq.conf with extra snippets in /etc/dnsmasq.d read in order. DHCP ranges, DNS forwarders, and local records all live there. NetworkManager can run its own copy with separate settings.
Back up both paths before router changes. Validate with config check flags and restart the service. Leases sit apart in the lease file and rebuild automatically.
Where dnsmasq stores this, by platform
/etc/dnsmasq.conf
Main config plus /etc/dnsmasq.d snippets. Root owned. Restart the service after edits and check status for parse errors.
Frequently asked questions
How do I add local DNS records in dnsmasq?
Add address or host-record lines in the conf or a drop in file, then restart. Test with dig against localhost before pointing clients.
Where are dnsmasq DHCP leases?
In the lease file path set in config, often under /var/lib/misc. They rebuild on their own. Back up config, not leases.
Notice an outdated path? Let us know.