NM + dnsmasq: server addresses in the wrong order

Bug #1163047 reported by Joe Barnett
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
Confirmed
Medium
Mathieu Trudel-Lapierre

Bug Description

My corporate DHCP servers send 3 DNS servers: 2 internal ones, and a tertiary backup of 8.8.8.8. If I only connect wired or wireless, everything appears to work fine as long as I've added "strict-order" to /etc/NetworkManager/dnsmasq.d/options, but if I connect both, it appears to invert the first list sent to dnsmasq, and I end up unable to resolve internal hostnames.

nm-tool output:
- Device: eth0 [Auto eth0] ----------------------------------------------------
...
    DNS: 10.0.5.25
    DNS: 10.0.5.26
    DNS: 8.8.8.8
- Device: wlan0 [Auto COMPANY AP] -----------------------------------------------
...
    DNS: 10.0.5.25
    DNS: 10.0.5.26
    DNS: 8.8.8.8

syslog output:
Apr 1 16:04:42 taplop NetworkManager[1744]: <info> ((null)): writing resolv.conf to /sbin/resolvconf
Apr 1 16:04:42 taplop dnsmasq[2155]: setting upstream servers from DBus
Apr 1 16:04:42 taplop dnsmasq[2155]: using nameserver 8.8.8.8#53
Apr 1 16:04:42 taplop dnsmasq[2155]: using nameserver 10.0.5.26#53
Apr 1 16:04:42 taplop dnsmasq[2155]: using nameserver 10.0.5.25#53
Apr 1 16:04:42 taplop dnsmasq[2155]: using nameserver 10.0.5.25#53
Apr 1 16:04:42 taplop dnsmasq[2155]: using nameserver 10.0.5.26#53
Apr 1 16:04:42 taplop dnsmasq[2155]: using nameserver 8.8.8.8#53

nslookup outputs hitting dnsmasq vs/ internal nameserver directly:
$ nslookup rb 127.0.1.1
Server: 127.0.1.1
Address: 127.0.1.1#53

Non-authoritative answer:
Name: rb.company.com
Address: [www.company.com]

$ nslookup rb 10.0.1.25
Server: 10.0.1.25
Address: 10.0.1.25#53

rb.company.com canonical name = rbp01.company.com.
Name: rbp01.company.com
Address: 10.0.1.35

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: network-manager 0.9.6.0-0ubuntu7
ProcVersionSignature: Ubuntu 3.5.0-27.46-generic 3.5.7.7
Uname: Linux 3.5.0-27-generic x86_64
NonfreeKernelModules: fglrx
ApportVersion: 2.6.1-0ubuntu10
Architecture: amd64
Date: Mon Apr 1 16:05:18 2013
IfupdownConfig:
 auto lo
 iface lo inet loopback
InstallationDate: Installed on 2010-04-19 (1078 days ago)
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Release Candidate amd64 (20100419.1)
IpRoute:
 default via 10.9.5.1 dev eth0 proto static
 10.9.5.0/24 dev eth0 proto kernel scope link src 10.9.5.59 metric 1
 10.9.5.0/24 dev wlan0 proto kernel scope link src 10.9.5.58 metric 9
 169.254.0.0/16 dev wlan0 scope link metric 1000
MarkForUpload: True
NetworkManager.state:
 [main]
 NetworkingEnabled=true
 WirelessEnabled=true
 WWANEnabled=true
SourcePackage: network-manager
UpgradeStatus: Upgraded to quantal on 2012-10-05 (178 days ago)
nmcli-dev:
 DEVICE TYPE STATE DBUS-PATH
 eth0 802-3-ethernet connected /org/freedesktop/NetworkManager/Devices/2
 wlan0 802-11-wireless connected /org/freedesktop/NetworkManager/Devices/0
nmcli-nm:
 RUNNING VERSION STATE NET-ENABLED WIFI-HARDWARE WIFI WWAN-HARDWARE WWAN
 running 0.9.6.0 connected enabled enabled enabled enabled disabled

Revision history for this message
Joe Barnett (thejoe) wrote :
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Tentatively confirming; I think I have an idea what might be causing this, though not necessarily how to fix just yet. Assigning to myself so I can take a look at the code to figure it out.

Changed in network-manager (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Mathieu Trudel-Lapierre (mathieu-tl)
Revision history for this message
Joe Barnett (thejoe) wrote :

awesome, let me know if I can help test anything

Revision history for this message
Thomas Hood (jdthood) wrote :

As of Ubuntu 12.10 you can't deal with bug #1003842 ("dnsmasq sometimes fails to resolve private names in networks with non-equivalent nameservers") by turning on "strict-order" in /etc/NetworkManager/dnsmasq.d/. The reason is that, since 12.10, NM sends nameserver addresses to dnsmasq over D-Bus; and in that case the order of the nameservers is not preserved.

    https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1003842/comments/49

The best workaround is to comment out "dns=dnsmasq" in /etc/NetworkManager/NetworkManager.conf and then restart network-manager.

summary: - with multiple connections, puts dnsmasq servers in wrong order
+ NM + dnsmasq: server addresses in the wrong order
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.