Site Navigation

Jan 15, 2013

/etc/hosts File Reverts/Resets/Overwritten on Reboot using OS X Mountain Lion

OS X pictureProblem: After configuring your /etc/hosts or /private/etc/hosts file, your OS X Mountain Lion system resolves the new names fine, everything works. Upon reboot, both hosts files are overwritten and reset to their default values.

Solution: It turns out if you use Cisco AnyConnect for your VPN, this is the source of your problem. If you look at your /etc directory, you will see a file named hosts.ac. AnyConnect uses this file to overwrite the other two on every reboot. Put your edits in hosts.ac and reboot your system. All your hosts files should now be synced up.

This happened to me on a new Mac Mini which I have been setting up since 01/08/2013. Since this never has happened to me before on any Mac, I think it is safe to assume that if the /etc/hosts file is configured before installing Cisco AnyConnect your changes are preserved. However, if you install AnyConnect before you make changes to /etc/hosts, the result is the behavior described above.
Post a Comment

Favorite Links Feed