Comment 14 for bug 632896

Revision history for this message
In , Andrew (andrew-redhat-bugs) wrote :

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
127.0.0.1 localhost.localdomain localhost
::1 machinename localhost6.localdomain6 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):
NetworkManager-0.8.1-4.git20100817.fc13.i686

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?