DNS breaks when port=0 is used in dnsmasq.conf
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dnsmasq (Ubuntu) |
Triaged
|
Low
|
Unassigned |
Bug Description
The following function is defined in /etc/init.
start_resolvconf()
{
# If interface "lo" is explicitly disabled in /etc/default/
# Then dnsmasq won't be providing local DNS, so don't add it to
# the resolvconf server set.
for interface in $DNSMASQ_EXCEPT
do
[ $interface = lo ] && return
done
if [ -x /sbin/resolvconf ] ; then
fi
return 0
}
When someone puts port=0 in dnsmasq.conf, because e.g. he wants to use it only as a (proxy)DHCP/TFTP server,
127.0.0.1 is added to resolvconf, and DNS is broken because nothing listens there.
One workaround is to put DNSMASQ_EXCEPT=lo in /etc/default/
But that doesn't make much sense, we don't want to exclude some interface, we're not running a DNS server at all.
So it would be nice if dnsmasq checked if port=0 is defined in its configuration, and didn't add 127.0.0.1 to resolvconf then.
Sample implementation code, to be inserted before `if [ -x /sbin/resolvconf ]`:
grep -qr port=0 /etc/dnsmasq.d/ /etc/dnsmasq.conf && return
tags: | removed: needs-upstream-report |
Better regex to avoid a possibly commented #port=0: ]]*port= 0" /etc/dnsmasq.d/ /etc/dnsmasq.conf && return
grep -qr "^[[:space: