Contributors have claimed here (bug #993298) above that /etc/hosts is no
longer respected, but that is not the case. As always, with
hosts: files [...]
in /etc/nsswitch.conf, the libc resolver consults /etc/hosts first.
Yes, NM runs dnsmasq with the no-hosts option. Consequently a DNS lookup
on 127.0.0.1 does not respect /etc/hosts. But prior to Ubuntu 12.04, NM
didn't start a local nameserver at all; no DNS lookups were done
externally and /etc/hosts wasn't respected then either.
The contributors who say that /etc/hosts is "no longer" consulted must
(I conclude) have been running the standalone server version of dnsmasq
before. That dnsmasq respects /etc/hosts and listens at 127.0.0.1 by
default. Now, because of bug #959037 it is not possible in Ubuntu 12.04
to run standalone dnsmasq alongside nm-dnsmasq. But it *is* possible to
run standalone dnsmasq if nm-dnsmasq is disabled (by commenting out
"dns=dnsmasq" in /etc/NetworkManager/NetworkManager.conf and restarting
network-manager) and that should restore the old situation.
Assuming that the underlying wish is that standalone dnsmasq can be run
without the need to comment out "dns=dnsmasq", I propose to merge this
report with #959037 which discusses ways of realizing this. See, for
example, comment #88 in that bug report.
--
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to network-manager in Ubuntu.
https://bugs.launchpad.net/bugs/993298
Title:
Please make NetworkManager-controlled dnsmasq respect /etc/hosts
Status in “network-manager” package in Ubuntu:
Confirmed
Bug description:
Since 12.04 NetworkManager uses the dnsmasq plugin by default to
resolve DNS requests. Unfortunately the dnsmasq plug-in has --no-
hosts, etc. hard coded [1] which means (among other things) that after
the upgrade to 12.04 /etc/hosts will no longer be used to resolve DNS
requests. This changes the prior behavior of NetworkManager without
any visible warning to the end user. AFAICS there's no other way to
work around this problem as to manually revert the change and disable
the dnsmasq plug-in in the NetworkManager config, see [2,3]:
"To turn off dnsmasq in Network Manager, you need to edit
/etc/NetworkManager/NetworkManager.conf and comment the 'dns=dnsmasq'
line then do a 'sudo restart network-manager'."
This is of course not a bug in the NetworkManager which just behaves
as intended. The problem is in the change of the configuration of the
Ubuntu packaging which will probably leave many wondering why their
/etc/hosts suddenly no longer works. This cost me considerable time to
debug and probably is a usability problem for others, too.
Maybe you could provide a more visible documentation than that in [3]?
E.g., *including a comment in /etc/hosts that explains the change* and
how to work around it would have saved me a lot of time. It would have
automatically alerted me on upgrade as manual changes to /etc/hosts
would then have triggered a prompt while leaving those users with
standard /etc/hosts in peace.
Probably similar problems arise with other disabled config files and
could be alerted to the users? Thinking of resolv.conf, etc.
[1]
http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/src/dnsmasq-manager/nm-dnsmasq-manager.c,
line 285
[2] i.e. http://ubuntuforums.org/showthread.php?t=1968061
[3] http://www.stgraber.org/2012/02/24/dns-in-ubuntu-12-04/
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/993298/+subscriptions
--
Mailing list: https://launchpad.net/~desktop-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help : https://help.launchpad.net/ListHelp