Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 yesterday, my /etc/hosts file disappears "magically" on restart. When I recreate it via sudo vim hosts everything works, but it's gone once I restart. I'm on Mac OSX 10.6.8, running MAMP 1.9.4 (recently added new virtual hosts, worked without problems before). After every restart /etc/hosts and /private/etc/hosts show only these:


The ~orig files are my own backups, I'm aware of the issue and have thus created as a link file (ln - alias of hosts). However now it's just empty, because hosts is not there. Any ideas?

share|improve this question
up vote 1 down vote accepted

Well, I opened the Console applications to check the logs on startup and here is the "magic" that happened:

4/9/12 12:02:05 PM  vpnagent[47]    Restoring backup hosts file: /etc/

D'uh. is an empty link file and overwrites hosts at every startup. Hence, no hosts file after startup. I just reversed the link ( links to hosts), restarted and it worked. Question is answered.

share|improve this answer

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.