Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Since I upgraded my laptop to Ubuntu 11.10 32-bit, the entry I add to /etc/hosts for my home server keeps disappearing on boot. I have to edit the hosts file every time I start up and want to access my server (which is most times) and I’d really rather not. Any idea what’s causing this? Here’s my edited /etc/hosts:   localhost   galileo    myserver

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
share|improve this question
up vote 6 down vote accepted

This is not normal but shows up for some systems. Here is a bug from Launchpad. So, you can upgrade Network Manager using this PPA. But I don't know how good it is and even necassary.

You can simply use this after changing the file:

sudo chattr +i /etc/hosts

So, it will be closed for any changes. If you want to change it in the future use this:

sudo chattr -i /etc/hosts
share|improve this answer
I was going to suggest the same thing. This is a bit like killing a mosquito with a sledgehammer, so if there's another way, you should do so. But, this will work. – Scott Severance Dec 2 '11 at 8:49
chattr worked — thanks for the solution and the bug link – misterhaan Dec 5 '11 at 5:30
You're welcome. I am glad that it worked. – heartsmagic Dec 5 '11 at 8:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.