Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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:

127.0.0.1   localhost
127.0.1.1   galileo
192.168.3.10    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
add comment

1 Answer

up vote 5 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
add comment

Your Answer

 
discard

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.