[Bug 1315741] Re: After upgrading from 12.04 to 14.04, network manager puts 127.0.0.1 instead of 127.0.1.1 in resolv.conf
Thomas Hood
1315741 at bugs.launchpad.net
Sun May 4 05:14:49 UTC 2014
If the "dnsmasq" package is not installed then purging the dnsmasq
package will remove /etc/init.d/dnsmasq and solve your problem.
Do not purge or remove the "dnsmasq-base" package. The dnsmasq-base
package includes the dnsmasq binary which is used by NetworkManager.
Of course, the question remains: why was /etc/init.d/dnsmasq registering
an address with resolvconf when the dnsmasq package was not installed?
Ahaaaa.
At the top of /etc/init.d/dnsmasq there is a "test - x /usr/sbin/dnsmasq
|| exit 0" which causes the initscript to exit if the dnsmasq binary is
not present. When a daemon is packaged in the standard way, the binary
is present if and only if the package is installed and a test like this
suffices to disable the initscript if and only if the package is not
installed.
But not in the case of the "dnsmasq" package. The binary is in dnsmasq-
base. So the initscript does not disable itself when the dnsmasq package
is removed.
This is a bug.
For reference, Debian policy §9.3.2 says the following.
«
These scripts should not fail obscurely when the configuration files remain but the package has been removed, as configuration files remain on the system after the package has been removed. Only when dpkg is executed with the --purge option will configuration files be removed. In particular, as the /etc/init.d/package script itself is usually a conffile, it will remain on the system if the package is removed but not purged. Therefore, you should include a test statement at the top of the script, like this:
test -f program-executed-later-in-script || exit 0
»
I am quite surprised that this bug hasn't been noticed before.
Reading the initscript I see another bug: the script fails to look at
the return value of the "start" function. I will file a separate report
about that, since it is not the cause of your problem.
** Changed in: resolvconf (Ubuntu)
Status: New => Confirmed
** Summary changed:
- After upgrading from 12.04 to 14.04, network manager puts 127.0.0.1 instead of 127.0.1.1 in resolv.conf
+ The dnsmasq initscript fails to disable itself when the dnsmasq package is removed
--
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/1315741
Title:
The dnsmasq initscript fails to disable itself when the dnsmasq
package is removed
Status in “resolvconf” package in Ubuntu:
Confirmed
Bug description:
I upgraded from 12.04 to 14.04 and found that I had no DNS. After a
little searching I noticed that dnsmasq, as started by Network
Manager, was listening on 127.0.1.1, yet /etc/resolv.conf was being
auto-populated with 127.0.0.1, so DNS lookups were failing.
Manually adding 127.0.1.1 to /etc/resolv.conf lets DNS work until the
network state changes, then it gets overwritten again with 127.0.0.1.
I've worked around the issue by adding "nameserver 127.0.1.1" to
/etc/resolvconf/resolv.conf.d/head and restarting network-manager.
Something left over from 12.04 is apparently still causing 127.0.0.1
to be written instead of 127.0.1.1.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1315741/+subscriptions
More information about the foundations-bugs
mailing list