Beta 42

Research and Development

Menu

Mac OS X - Access Hosts File on Mac OS X Lion

sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts

In Mac OS X Lion this is no longer possible due to sandboxing.

The best option to access hosts file on Lion is Terminal:

sudo vim /private/etc/hosts

Any terminal editor will do (vi, vim, nano, etc).