Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 257039 - net-dns/openresolv-2.0 - /etc/resolvconf/update.d/dnsmasq does not sync properly with dnsmasq-2.45
Summary: net-dns/openresolv-2.0 - /etc/resolvconf/update.d/dnsmasq does not sync prope...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Jim Ramsay (lack) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-31 03:21 UTC by peyser.alex
Modified: 2009-07-24 13:31 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for /etc/resolvconf/update.d/dnsmasq (dnsmasq.diff,1.47 KB, text/plain)
2009-01-31 03:23 UTC, peyser.alex
Details

Note You need to log in before you can comment on or make changes to this bug.
Description peyser.alex 2009-01-31 03:21:17 UTC
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.
Comment 1 peyser.alex 2009-01-31 03:23:04 UTC
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.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2009-01-31 15:00:48 UTC
CC'ing dnsmasq maintainer for good measure.
Comment 3 Roy Marples 2009-03-19 11:20:29 UTC
(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?
Comment 4 Roy Marples 2009-03-19 23:27:00 UTC
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/
Comment 5 Jim Ramsay (lack) (RETIRED) gentoo-dev 2009-07-24 13:31:34 UTC
This is fixed in later openresolv versions.