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

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:

hostconfig
hostconfig~orig 
hosts.ac
hosts~orig

The ~orig files are my own backups, I'm aware of the hosts.ac issue and have thus created hosts.ac 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/hosts.ac

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

share|improve this answer

You must log in to answer this question.

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