Changing hosts file on snow leopard

hostsosx-snow-leopard

I need to add an entry to my hosts file on Snow Leopard. I could edit the hosts file with root user enabled, but in the system doesn't let me to save this file saying that I don't have permissions to make changes to this file since it's located in non-writable directory.
How do i save changes there?

Thanks,

Nava

Best Answer

Try it from the command line:

sudo nano /private/etc/hosts

Type your user password when prompted for a password.

For more help, please refer to this blog posting:

http://decoding.wordpress.com/2009/04/06/how-to-edit-the-hosts-file-in-mac-os-x-leopard/

Please note that you might have to reset the DNS cache with this command after changing the hosts file:

dscacheutil -flushcache

Related Question