I have two interfaces:
wlan0- Wi-Fi client configured via DHCP;wlan1- static IP address, runninghostapdto act as access point, runningdnsmasqto give out IP addresses and service DNS requests on that interface.
Unfortunately, it seems that when dnsmasq runs, something overwrites the resolv.conf and sets the local dnsmasq to take over for the local queries. Here is the resolv.conf after dnsmasq has run...
pi@raspberrypi:~$ cat /etc/resolv.conf
# Generated by resolvconf
domain home
nameserver 127.0.0.1
dnsmasq is only bound to wlan1, and in any case was never configured to take over as the local name resolver.
If I kill dnsmasq and then refresh the DHCP lease, then the resolv.conf file has the correct DNS servers as configured via DHCP.
I think this might be the result of an interaction with resolv.conf, but I am not sure.
I can not figure out who is overwriting the local machine DNS server configuration to point to the local dnsmasq server, or how to correctly prevent this from happening.
Note that the reason I want to have dnsmasq only answer DNS requests on wlan1 is because I want to set that interface up to create a captive portal for configuring the SSID on the wlan0 interface though a web page, and the software running on the machine will use the wlan0 connection to get out to the internet.
/etc/default/dnsmasqnow has an option to un-hash at the end, which does the job:IGNORE_RESOLVCONF=yes. – Maynard Aug 08 '16 at 13:53IGNORE_RESOLVCONF=yesdoesn't actually do anything, addingDNSMASQ_EXCEPT=loactually fixed the problem. This was on rasbian 2018-03-13 with dnsmasq 2.76. – mtfurlan Apr 16 '18 at 19:38