Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've setup a brand new linux machine with Ubuntu 8.04. I've added a few hosts in /etc/hosts but upon reboot of the OS, the file is reset to its original content. The original content looks like:

127.0.0.1 localhost.localdomain localhost
# Auto-generated hostname. Please do not remove this comment.
00.00.0.000 myhost

I'm actually using a real ip number instead of the series of zero above. Does anyone know how I can prevent my hosts file from being wiped after a reboot?

share|improve this question
1  
127.0.0.1 is real; it's the loopback address. if you manage to get the hosts file to be persistent make sure you leave that line alone. (speaking of persistent, you aren't booting into the LiveCD are you?) –  quack quixote Oct 8 '09 at 20:04
    
Oh no, the OS is fully installed and booting from the hard drive. –  Thierry Lam Oct 8 '09 at 20:14
    
thought so; just making sure. –  quack quixote Oct 8 '09 at 20:20
    
~quack: I think the "series of zero" line is 00.00.0.000, not the loopback line. –  grawity Oct 9 '09 at 7:46
add comment

1 Answer

up vote 0 down vote accepted

Actually, the answer is in my question, I just deleted the comment and the file is not overwritten on reboot, I deleted the following line:

# Auto-generated hostname. Please do not remove this comment.
share|improve this answer
1  
that's it?? remove the comment and whatever it is stops resetting the file? how bizarre. –  quack quixote Oct 8 '09 at 20:52
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.