Leaves unreachable entries in /etc/hosts when stopping network
Bug #632896 reported by
Anders Kaseorg
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NetworkManager |
Fix Released
|
Medium
|
|||
Fedora |
Fix Released
|
Critical
|
|||
network-manager (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Maverick |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: network-manager
NetworkManager modifies /etc/hosts to look like this:
18.111.118.108 balanced-tree # Added by NetworkManager
127.0.0.1 localhost.
::1 balanced-tree localhost6.
127.0.1.1 balanced-tree
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
But when stopping the network, it does not undo these modifications. This leaves the system hostname pointing at a non-routable address, which breaks various applications.
tags: | added: regression-potential |
Changed in network-manager: | |
status: | Unknown → New |
Changed in network-manager: | |
importance: | Unknown → Medium |
Changed in network-manager: | |
status: | New → Incomplete |
Changed in network-manager: | |
status: | Incomplete → New |
tags: | added: patch |
tags: | added: patch-accepted-upstream |
Changed in network-manager: | |
status: | New → Fix Released |
tags: |
added: regression-release removed: regression-potential |
Changed in network-manager (Ubuntu): | |
assignee: | Mathieu Trudel-Lapierre (mathieu-tl) → nobody |
Changed in fedora: | |
importance: | Unknown → Critical |
status: | Unknown → Fix Released |
To post a comment you must log in.
Description of problem:
NetworkManager apparently adds an entry in /etc/hosts when it
gets an IP address. The problem is that it doesn't remove it
if the network connection is no longer present. This results in
an /etc/hosts that looks like :
x.x.x.x machinename # Added by NetworkManager localdomain localhost localdomain6 localhost6
127.0.0.1 localhost.
::1 machinename localhost6.
so that any lookups of machinename go to a non-accessible
address. The severity of the problem is that virtually no
gnome applications will function (in particular GDM, but also
gnome-panel, etc.) without being able to access machinename
(which should be 127.0.0.1), thus crippling the machine
until /etc/hosts is fixed or the network connection resumes.
Version-Release number of selected component (if applicable): 0.8.1-4. git20100817. fc13.i686
NetworkManager-
How reproducible:
Always
Steps to Reproduce:
1. Boot system
2. Plug in network wire and get IP address (/etc/hosts should be modified)
3. Unplug network wire (/etc/hosts stays the same)
4. Restart X and notice GDM no longer works
Actual results:
Lookups to machinename go to unreaching IP address instead of 127.0.0.1,
GDM fails to function
Expected results:
/etc/hosts should be changed to put machinename back to 127.0.0.1 if no network is available
Additional info:
I ended up chattr +i /etc/hosts to keep it from being modified at all.
Why should the local machinename ever point to anything other than 127.0.0.1?