How make changing to the /etc/hosts file take effect?
I added some lines to my /etc/hosts
file to resolve a private hostname, but every time after rebooting, the lines I added get lost. Should there be any setting options to make these changes take effect?
The Cisco AnyConnect VPN Client is known to show this behavior. It will reset your /etc/hosts
file on reboot to the contents of /etc/hosts.ac
.
If you use this VPN client, you should make your modifications to both files.
See this hint for more info.
http://hints.macworld.com/article.php?story=20111011050950471
Looks like some app deletes this lines from /etc/hosts
on system startup. OS X itself doesn't delete any lines on startup nor reboot.
After changing the hosts file, change the permissions on it to stop the file being modified. You may have to play a bit to see what works.