Ask Different is a question and answer site for power users of Apple hardware and software. 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

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?

share|improve this question
Do you edit it from root? – Daniil Ryzhkov Aug 31 '12 at 2:54
@Daniil yes, of course – qiuxiafei Aug 31 '12 at 6:51
Are you using some third-party VPN client. Some "disfunctional" clients modify the /etc/hosts files themselves. – Gerry Aug 31 '12 at 8:09
up vote 4 down vote accepted

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/

If you use this VPN client, you should make your modifications to both files.

See this hint for more info.

share|improve this answer
god, i really use Cisco AnyConnect VPN... – qiuxiafei Sep 5 '12 at 1:49

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.

share|improve this answer
And my estimated guess would be a third party VPN client. – Gerry Aug 31 '12 at 8:04

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.

share|improve this answer

Try sudo nano /private/etc/hosts in Terminal.

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.