Aliases in /etc/hosts overwritten
Binary package hint: network-manager
You can use aliases against another loopback address in the 127.x.y.z range, such as 127.1.1.z. Addresses within 127.0.y.z are rewritten by NM.
In its current state NetworkManager overwrites static entries placed in /etc/hosts, users requiring such aliases for Apache servers or whatnot cannot add them (except using the workaround above). This constitutes a regression from the Lucid release, as well as somewhat of an issue for upgrades.
This has been addressed in natty by cherry-picking a patch from the upstream stable git branch which corrects the issue: looking for entries not matching the known hostname and skipping them.
Regression potential is medium/low: users with the patch, in the event it was to break, would lose alias entries, or possibly the hosts entry for the interface's IP. However, standard loopback/localhost entries remain and are ignored.
1) Add a custom entry to /etc/hosts sending to the loopback address. e.g.
2) Click on nm-applet, then the already-establish connection to have it re-negotiated.
In the current version in maverick, network-manager removed the entry. With the patch applied, the entry is left intact.
I develop several web sites on my laptop, and each one is a different virtual host through Apache. Until Lucid, I was able to alias these hosts in /etc/hosts, like this
127.0.0.1 localhost localhost.
Starting with Maverick, however, NetworkManager overwrites the 127.0.0.1 line every time it initiates a new network connection, so these aliases are lost. It is fair to argue that aliasing 127.0.0.1 isn't ideal, but as far as I can find, NetworkManager doesn't offer any alternative for aliasing the bound IP address. For example, if I connect to WiFi, it adds a line like
There seems to be no way to get it to do
192.168.0.101 snape myhost1.localdomain myhost2.localdomain myhost3.localdomain
NetworkManager should not overwrite the 127.0.0.1 line in /etc/hosts until there is an alternative method available for aliasing on the local machine, without setting up an entire local DNS server.
DistroRelease: Ubuntu 10.10
Package: network-manager 0.8.1+git.
Uname: Linux 2.6.35-22-generic x86_64
CRDA: Error: [Errno 2] No such file or directory
Date: Wed Oct 13 08:22:07 2010
iface lo inet loopback
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release Candidate amd64 (20100928)
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.198 metric 1
169.254.0.0/16 dev eth0 scope link metric 1000
default via 192.168.0.1 dev eth0 proto static
Keyfiles: Error: [Errno 2] No such file or directory
0: hp-wifi: Wireless LAN
Soft blocked: no
Hard blocked: no
|Changed in network-manager (Ubuntu):|
|status:||New → Triaged|
|importance:||Undecided → Low|
|Mathieu Trudel-Lapierre (mathieu-tl) wrote : Re: [Bug 659872] Re: Aliases in /etc/hosts overwritten||#25|