Kamal DS personal blog

where I write anything that comes to my (techy) mind

Edit Hosts file in Mac OS X Lion

leave a comment »

I have seen that the old command, that is, sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts no longer works inside the terminal and instead you get weird, not-so-user friendly errors.

Edit hosts mac os x lion

 

Here is how you get around this problem. Try using this command. Make sure you know your root password.
sudo nano /private/etc/hosts
Type in the password if prompted. Edit the host file and save and close it by using control + o and control + x respectively. To flush the DNS cache, type in dscacheutil -flushcache

Written by Ding

September 16, 2011 at 11:57

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.