/var/run/dnsmasq/resolv.conf empty on boot

Bug #875950 reported by Andrew Bayliss
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
dnsmasq (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

I have a machine that serves as a router, with an ADSL modem on one ethernet port, the rest of my network on the other, and using dnsmasq to provide DNS/DHCP to the network. In the past dnsmasq and ppp have happily co-existed, with dnsmasq reading the upstream DNS servers from /var/run/dnsmasq/resolv.conf. After upgrading to Oneiric, I'm finding that /var/run/dnsmasq/resolv.conf is always empty on boot. If I if{down,up} ppp0, the upstream servers are written to this file, dnsmasq picks them up and everything starts working.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: dnsmasq 2.57-1ubuntu1 [modified: etc/dnsmasq.conf]
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
Uname: Linux 3.0.0-12-generic i686
ApportVersion: 1.23-0ubuntu3
Architecture: i386
Date: Sun Oct 16 21:00:24 2011
PackageArchitecture: all
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, no user)
 LANG=en_GB.UTF-8
SourcePackage: dnsmasq
UpgradeStatus: Upgraded to oneiric on 2011-10-16 (0 days ago)
mtime.conffile..etc.dnsmasq.conf: 2011-10-16T20:16:02.720988

Revision history for this message
Andrew Bayliss (abayliss) wrote :
Revision history for this message
Scott Moser (smoser) wrote :

I suspect that this is related to bug 876458.

Revision history for this message
Andrew Bayliss (abayliss) wrote :

I initially thought it might be boot order related, but I'm not convinced. Restarting dnsmasq does not fix the problem, as /var/run/dnsmasq/resolv.conf is still empty. Taking my ppp0 interface down/up solves the problem as dnsmasq notices that the contents of /var/run/dnsmasq/resolv.conf has changed.

Revision history for this message
Carl Davis (carl.davis) wrote :

Andrew,

Can you please look at bug 862134 and determine if network-manager overwriting resolv.conf is causing your issues with dnsmasq?

---
Ubuntu Bug Squad volunteer triager
http://wiki.ubuntu.com/BugSquad

Revision history for this message
Andrew Bayliss (abayliss) wrote :

NetworkManager is not installed on this machine.

Changed in dnsmasq (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Chad Kidder (cckidder) wrote :

I can verify this on my 11.10 server using two ethernet networks. Network manager is not installed. Please see the attached configuration files.

Revision history for this message
Chad Kidder (cckidder) wrote :

A short term hack seems to be to change the location of the resolv.conf pointed to in the daemon script, /etc/init.d/dnsmasq.

I changed it to point to /etc/resolvconf/resolv.conf.d/original instead of /var/run/dnsmasq/resolv.conf and that seems to have worked around the problem.

From what I can tell, until the interface with DHCP is brought down then up, the resolvconf update script for dnsmasq is not getting the DNS servers given by DHCP.

Revision history for this message
Chad Kidder (cckidder) wrote :

It seems that my problem can be traced to putting a gateway line in my /etc/network/interfaces file for the static internal interface. That was causing routing problems as well. After removing the gateway line and restarting networking and dnsmasq I now have name servers in /var/run/dnsmasq/resolv.conf.

Revision history for this message
Chad Kidder (cckidder) wrote :

On further inspection, it did not solve the problem. restarting the networking along with the fix of the gateway solved the problem. To get it working reliably, I had to add:

ifdown eth1 && ifup eth1 into /etc/init.d/dnsmasq in the start section.

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

This may have been a bug in resolvconf, specifically #366967 et al. If so then it has been fixed in Precise. Please check.

Revision history for this message
Andrew Bayliss (abayliss) wrote :

Yes, this appears to have been fixed in Precise.

Thomas Hood (jdthood)
Changed in dnsmasq (Ubuntu):
status: New → Fix Released
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.