Caching dnsmasq stops resolving after some time

Bug #1637700 reported by Michał Sawicz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
New
Undecided
Unassigned

Bug Description

Since upgrading to yakkety my network sometimes stops working - it might be related to suspending the laptop. The NetworkManager-managed caching dnsmasq just stops resolving at some point:

 dig google.com @127.0.1.1

; <<>> DiG 9.10.3-P4-Ubuntu <<>> google.com @127.0.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 22521
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com. IN A

;; Query time: 0 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Sat Oct 29 09:12:33 CEST 2016
;; MSG SIZE rcvd: 28

Networking and upstream DNS are fine:

 dig google.com @8.8.8.8

; <<>> DiG 9.10.3-P4-Ubuntu <<>> google.com @8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63345
;; flags: qr rd ra; QUERY: 1, ANSWER: 16, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;google.com. IN A

;; ANSWER SECTION:
google.com. 299 IN A 46.134.208.30
[...]

;; Query time: 43 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sat Oct 29 09:12:31 CEST 2016
;; MSG SIZE rcvd: 295

Killing it resolves the issue, dnsmasq gets restarted and works again:

 ps aux | grep dnsmasq
nobody 4262 0.0 0.0 54308 2740 ? S 01:30 0:00 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/NetworkManager/dnsmasq.pid --listen-address=127.0.1.1 --cache-size=0 --conf-file=/dev/null --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d
 sudo kill 4262
 dig google.com @127.0.1.1

; <<>> DiG 9.10.3-P4-Ubuntu <<>> google.com @127.0.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58324
;; flags: qr rd ra; QUERY: 1, ANSWER: 16, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;google.com. IN A

;; ANSWER SECTION:
google.com. 299 IN A 46.134.208.59
[...]

;; Query time: 41 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Sat Oct 29 09:12:54 CEST 2016
;; MSG SIZE rcvd: 295

ProblemType: Bug
DistroRelease: Ubuntu 16.10
Package: dnsmasq (not installed)
ProcVersionSignature: Ubuntu 4.8.0-26.28-generic 4.8.0
Uname: Linux 4.8.0-26-generic x86_64
NonfreeKernelModules: zfs zunicode zcommon znvpair zavl
ApportVersion: 2.20.3-0ubuntu8
Architecture: amd64
CurrentDesktop: Unity
Date: Sat Oct 29 09:13:04 2016
InstallationDate: Installed on 2016-05-06 (175 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
SourcePackage: dnsmasq
UpgradeStatus: No upgrade log present (probably fresh install)
---
ApportVersion: 2.20.3-0ubuntu8
Architecture: amd64
CurrentDesktop: Unity
DistroRelease: Ubuntu 16.10
IfupdownConfig:
 # interfaces(5) file used by ifup(8) and ifdown(8)
 auto lo
 iface lo inet loopback
InstallationDate: Installed on 2016-05-06 (175 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
NetworkManager.state:
 [main]
 NetworkingEnabled=true
 WirelessEnabled=false
 WWANEnabled=true
NonfreeKernelModules: zfs zunicode zcommon znvpair zavl
Package: network-manager 1.2.4-0ubuntu1
PackageArchitecture: amd64
ProcVersionSignature: Ubuntu 4.8.0-26.28-generic 4.8.0
Tags: yakkety third-party-packages
Uname: Linux 4.8.0-26-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dialout dip libvirt libvirtd lpadmin lxd plugdev sambashare sbuild sudo vboxusers
_MarkForUpload: True
modified.conffile..etc.polkit-1.localauthority.50-local.d.org.freedesktop.NetworkManager.pkla: [deleted]
nmcli-nm:
 RUNNING VERSION STATE STARTUP CONNECTIVITY NETWORKING WIFI-HW WIFI WWAN-HW WWAN
 running 1.2.4 connected started full enabled enabled disabled enabled enabled

Revision history for this message
Michał Sawicz (saviq) wrote :
tags: added: apport-collected third-party-packages
description: updated
Revision history for this message
Michał Sawicz (saviq) wrote : CRDA.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote : Dependencies.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote : IpAddr.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote : IpRoute.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote : IwConfig.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote : JournalErrors.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote : NetDevice.enx00133b4909cd.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote : NetDevice.lo.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote : NetDevice.lxcbr0.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote : NetDevice.virbr0.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote : NetDevice.virbr0-nic.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote : NetDevice.wlp6s0.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote : NetworkManager.conf.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote : PciNetwork.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote : ProcEnviron.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote : RfKill.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote : WifiSyslog.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote : nmcli-con.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote : nmcli-dev.txt

apport information

Revision history for this message
Michał Sawicz (saviq) wrote :

Some potentially relevant lines from journal:

When I woke the machine up and resolving didn't work.

paź 29 09:09:17 michal-laptop dnsmasq[4262]: setting upstream servers from DBus

When I tried to reconnect the network, but that didn't help.

paź 29 09:09:22 michal-laptop dnsmasq[4262]: setting upstream servers from DBus
paź 29 09:09:22 michal-laptop dnsmasq[4262]: using nameserver 10.2.0.1#53(via enx00133b4909cd)

And when I killed dnsmasq:

paź 29 09:12:50 michal-laptop NetworkManager[3485]: <warn> [1477725170.2579] dns-mgr: plugin dnsmasq child quit unexpectedly
paź 29 09:12:50 michal-laptop NetworkManager[3485]: <info> [1477725170.2580] dns-plugin[0x5648fb2f88d0]: starting dnsmasq...
paź 29 09:12:50 michal-laptop NetworkManager[3485]: <info> [1477725170.2602] dns-mgr: Writing DNS information to /sbin/resolvconf
paź 29 09:12:50 michal-laptop dnsmasq[22108]: started, version 2.76 cache disabled
paź 29 09:12:50 michal-laptop dnsmasq[22108]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
paź 29 09:12:50 michal-laptop dnsmasq[22108]: DBus support enabled: connected to system bus
paź 29 09:12:50 michal-laptop dnsmasq[22108]: warning: no upstream servers configured
paź 29 09:12:50 michal-laptop NetworkManager[3485]: <info> [1477725170.2706] dnsmasq[0x5648fb2f88d0]: dnsmasq disappeared
paź 29 09:12:50 michal-laptop NetworkManager[3485]: <info> [1477725170.2707] dns-mgr: Writing DNS information to /sbin/resolvconf
paź 29 09:12:50 michal-laptop NetworkManager[3485]: <info> [1477725170.3627] dnsmasq[0x5648fb2f88d0]: dnsmasq appeared as :1.2273
paź 29 09:12:50 michal-laptop dnsmasq[22108]: setting upstream servers from DBus
paź 29 09:12:50 michal-laptop dnsmasq[22108]: using nameserver 10.2.0.1#53(via enx00133b4909cd)

After that things are back in order.

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

In yakkety there is no longer supposed to be a local forwarding nameserver (instance of dnsmasq) listening at 127.0.1.1. Instead an instande of resolved is started. Name resolution requests are fed to it via the name service switch (configured with nsswitch.conf) rather than via the libc resolver (configured with resolv.conf).

Announcement: https://lists.ubuntu.com/archives/ubuntu-devel/2016-May/039350.html

Please post the output of the /usr/share/resolvconf/dump-debug-info utility.

Revision history for this message
Michał Sawicz (saviq) wrote :

Right!

Well, there still is in my case :)

That said, resolv.conf does not include it... I suppose the two fight for the right to "be" in resolvconf?

Here's the output: http://paste.ubuntu.com/23396426/

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

NetworkManager is starting a dnsmasq instance whereas it shouldn't do that any more.

affects: dnsmasq (Ubuntu) → ubuntu
Revision history for this message
Thomas Hood (jdthood) wrote :

Edit /etc/NetworkManager/NetworkManager.conf and comment out the line "dns=dnsmasq" with a leading '#'. Then reboot.

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

Compare bug #1631241.

Aron Xu (happyaron)
no longer affects: ubuntu
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.