[Bug 1000244] Re: /etc/resolv.conf symlink does not exist after initial installation of resolvconf package
Thomas Hood
1000244 at bugs.launchpad.net
Wed Oct 24 20:13:59 UTC 2012
Cerin, in your earlier comment (#75) you posted the results of several
commands. The content of /etc/resolv.conf was incorrect. It was:
# Generated by NetworkManager
domain home
search home
nameserver 127.0.0.1
If this file had been generated by resolvconf, it would have begun with
the contents of /etc/resolvconf/resolv.conf.d/head and not with the
comment "# Generated by NetworkManager". Furthermore, resolvconf never
writes a "domain" line. Comparing with what you describe as the correct
contents, the domain and search lines are also incorrect, listing "home"
instead of "mynetwork".
In the later comment (#77) you say that /etc/resolv.conf contains
# Generated by NetworkManager
domain mynetwork
search mynetwork
nameserver 127.0.0.1
Although the domain and search lines are now "correct", the content is
still not what resolvconf generates, so there is still something amiss.
It appears as if NetworkManager is overwriting /etc/resolv.conf. (I say
"appears" because some other program or script could be copying from a
resolv.conf that was once generated by NM.) But NetworkManager also
calls resolvconf, as evidenced by the fact that
/run/resolvconf/interface/NetworkManager exists and has the same
creation date and time as /run/resolvconf/resolv.conf. Accordingly, in
the log file WifiSyslog.txt you posted originally we see the following.
May 16 09:42:03 coronis NetworkManager[22975]: <info> (eth2):
writing resolv.conf to /sbin/resolvconf
Looking in the network-manager source code I see what is most likely the
cause of the problem. The code in src/dns-manager/nm-dns-manager.c is
essentially the following.
success = dispatch_resolvconf (domain, searches, nameservers, iface, error);
if (success == FALSE)
success = update_resolv_conf (domain, searches, nameservers, iface, error);
With this code, if resolvconf returns nonzero for any reason then
NetworkManager writes its output directly to (the target of)
/etc/resolv.conf. This is wrong. I already wrote about this issue ten
months ago.
https://bugs.launchpad.net/ubuntu/+source/network-
manager/+bug/324233/comments/30
Although the most serious of the several problems I discussed there have
been fixed in Quantal, the problem remains that NetworkManager does not
correctly handle a nonzero exit status returned by resolvconf.
When resolvconf runs if may or may not return an error. For example, if
some update.d hook script returns a nonzero status then that status is
returned. But as NetworkManager is currently coded, if resolvconf
returns an error for any reason then NM writes its nameserver
information directly to /etc/resolv.conf.
That NM behavior dates from the time that resolvconf was an optional
package in universe which returned nonzero status to indicate that
/etc/resolv.conf wasn't a symbolic link, and the NetworkManager
maintainers wanted to avoid leaving the user without a resolv.conf at
all costs. The behavior was inappropriate then (because it failed to
distinguish between an absent symlink and runtime errors) and is more
inappropriate now.
The appropriate behavior for NetworkManager is: IF resolvconf is
installed as evidenced by the presence of the file /sbin/resolvconf THEN
send nameserver information to /sbin/resolvconf ELSE write the
nameserver information directly to (the target of) /etc/resolv.conf.
I will file a new bug report requesting that this finally be
implemented.
In the short term, though, Cerin, you should find out why resolvconf
returns a nonzero status (... assuming it does and that this is the
cause of your problem) and fix the underlying problem that causes it to
do so.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to resolvconf in Ubuntu.
https://bugs.launchpad.net/bugs/1000244
Title:
/etc/resolv.conf symlink does not exist after initial installation of
resolvconf package
Status in “resolvconf” package in Ubuntu:
Incomplete
Bug description:
I upgraded an 11.10 install to 12.04, and now I'm unable to resolve
domain names because Network Manager does not populate my
/etc/resolv.conf file.
For example, my local wireless router uses the domain "mylocaldomain"
and nameservers 10.157.10.12 and 10.157.10.14, so in 11.10, after
connecting to the router I would see this in my /etc/resolv.conf:
domain mylocaldomain
search mylocaldomain
nameserver 10.157.10.12
nameserver 10.157.10.14
Now /etc/resolv.conf contains the settings last set before I upgraded
to 12.04, and doesn't update them for whatever network I'm currently
on. I have to manually guess the settings and modify /etc/resolv.conf
in order to resolve domain names.
I believe this may be related to
https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/922677 and
how the "resolvconf" program has been introduce to manage this. I
believe this is a new bug with how prior installs are improperly
upgraded.
I tried removing the line "dns=dnsmasq" from
/etc/NetworkManager/NetworkManager.conf and then running `sudo restart
network-manager`, but that had no effect.
I tried running `resolvconf --enable-updates` but I get the error
"resolvconf: Error: /etc/resolv.conf isn't a symlink, not doing
anything."
Based on https://help.ubuntu.com/12.04/serverguide/network-
configuration.html#name-resolution, I tried establishing this symlink
myself, but the file /run/resolvconf/resolv.conf does not exist on my
system.
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: network-manager 0.9.4.0-0ubuntu4
ProcVersionSignature: Ubuntu 3.2.0-24.37-generic 3.2.14
Uname: Linux 3.2.0-24-generic x86_64
NonfreeKernelModules: nvidia wl
ApportVersion: 2.0.1-0ubuntu7
Architecture: amd64
CRDA: Error: command ['iw', 'reg', 'get'] failed with exit code 1: nl80211 not found.
Date: Wed May 16 09:57:25 2012
IfupdownConfig:
auto lo
iface lo inet loopback
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64+mac (20111012)
IpRoute:
default via 192.168.1.1 dev eth2 proto static
169.254.0.0/16 dev eth2 scope link metric 1000
192.168.1.0/24 dev eth2 proto kernel scope link src 192.168.1.205 metric 2
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1
NetworkManager.state:
[main]
NetworkingEnabled=true
WirelessEnabled=true
WWANEnabled=true
WimaxEnabled=true
SourcePackage: network-manager
UpgradeStatus: Upgraded to precise on 2012-05-10 (5 days ago)
nmcli-dev:
DEVICE TYPE STATE DBUS-PATH
eth2 802-11-wireless connected /org/freedesktop/NetworkManager/Devices/1
eth0 802-3-ethernet unavailable /org/freedesktop/NetworkManager/Devices/0
nmcli-nm:
RUNNING VERSION STATE NET-ENABLED WIFI-HARDWARE WIFI WWAN-HARDWARE WWAN
running 0.9.4.0 connected enabled enabled enabled enabled enabled
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1000244/+subscriptions
More information about the foundations-bugs
mailing list