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.

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

1 Answer 1

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

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.