OPNsense Forum

English Forums => Tutorials and FAQs => Topic started by: OpnSenseUser123321 on July 15, 2025, 06:34:35 AM

Title: Advertise DNS server via DHCP using Dnsmasq
Post by: OpnSenseUser123321 on July 15, 2025, 06:34:35 AM
Hi.

Reading the docs I saw Dnsmasq is the recommended DHCP server. I can't figure out how to advertise a specific IP as the default DNS server for DHCP clients though.

I'm running pi-hole on 192.168.111.130. I've configured that as the default DNS server of OPNsense itself via System/Settings/General.

Also I've gotten this working when using ISC DHCPv4. But I can't figure out what the right setting is with Dnsmasq.

I've also attempted setting it via 'dhcp-option=6,192.168.111.130' in '/usr/local/etc/dnsmasq.conf.d/'. But this results in a log line in Dnsmasq 'Ignoring duplicate dhcp-option 6'.

I can see 'dhcp-option=6,0.0.0.0' in '/usr/local/etc/dnsmasq.conf' which I guess is overriding my option.
Title: Re: Advertise DNS server via DHCP using Dnsmasq
Post by: meyergru on July 15, 2025, 09:00:56 AM
Why don't you just use the DHCP options to set it instead of fiddling with custom settings?

dns-server.png