The dnsmasq update.d script in openresolv-2.0 incorrectly updates /etc/dnsmasq-resolv.conf both with & without dbus for domain specific servers. The nameserver is added to dnsmasq-resolv.conf in addition to being sent by dbus or put into /etc/dnsmasq-resolvconf.conf, which leads to that server being used for ALL dns requests, not just the domain specific requests. Additionally, dnsmasq was being unnecessarily SIGHUP'd before the dbus command. I assume that was to force a flushing of the cache -- but that can be done via dbus command; the SIGHUP is only required when dnsmasq-resolvconf.conf is updated, not when dnsmasq-resolv.conf is updated or a dbus command sent. Reproducible: Always Steps to Reproduce: 1. echo "domain x.com\nnameserver x.x.x.x" | resolvconf -a $dev 2. Look at /var/log/messages and in /etc/dnsmasq-resolv.conf and /etc/dnsmasq-resolvconf.conf. 3. Actual Results: SetServers uint:x.x.x.x string:x.com called, or server=/x.com/x.x.x.x added to dnsmasq-resolvconf.conf. /etc/dnsmasq-resolv.conf unchanged. Expected Results: nameserver x.com added incorrectly to /etc/dnsmasq-resolv.conf I'll add my patch to this bug.
Created attachment 180364 [details] Patch for /etc/resolvconf/update.d/dnsmasq Fixes the mentioned error by filtering out of dnsmasq-resolv.conf nameservers that have already been set elsewhere for dnsmasq.
CC'ing dnsmasq maintainer for good measure.
(In reply to comment #0) > The dnsmasq update.d script in openresolv-2.0 incorrectly updates > /etc/dnsmasq-resolv.conf both with & without dbus for domain specific servers. > The nameserver is added to dnsmasq-resolv.conf in addition to being sent by > dbus or put into /etc/dnsmasq-resolvconf.conf, which leads to that server being > used for ALL dns requests, not just the domain specific requests. This is by design. You need to mark the resolv.conf as private when adding to resolvconf like so echo "nameserver 1.2.3.4\n" | IF_PRIVATE=YES resolvconf -a eth0 or echo "nameserver 1.2.3.4\n" | resolvconf -p -a eth0 The former is command line compatible with Debian resolvconf. > Additionally, dnsmasq was being unnecessarily SIGHUP'd before the dbus command. > I assume that was to force a flushing of the cache -- but that can be done via > dbus command; the SIGHUP is only required when dnsmasq-resolvconf.conf is > updated, not when dnsmasq-resolv.conf is updated or a dbus command sent. This part of the patch could be valid though. Could you re-tool it around openresolv-3.1.1 please?
It just struck me that the calling program may or may not know about the openresolv -p flag or whether to use it or not. So I've added the private_interfaces option to /etc/resolvconf.conf http://roy.marples.name/projects/openresolv/changeset/119/trunk/
This is fixed in later openresolv versions.