Super User is a question and answer site for computer enthusiasts and power users. 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

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: localhost.localdomain localhost
# Auto-generated hostname. Please do not remove this comment. 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 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, not the loopback line. – grawity Oct 9 '09 at 7:46
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
that's it?? remove the comment and whatever it is stops resetting the file? how bizarre. – quack quixote Oct 8 '09 at 20:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .