Access Hosts File Mac OS X Lion


Recommended Posts

On Mac OS X Snow Leopard and below I used to be able to access the Hosts file using this command:

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

However, after installing Mac OS X Lion today I can't anymore. Any suggestions how to open and edit the file? Thanks in advance.

Link to comment
Share on other sites

On Mac OS X Snow Leopard and below I used to be able to access the Hosts file using this command:

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

However, after installing Mac OS X Lion today I can't anymore. Any suggestions how to open and edit the file? Thanks in advance.

I always just use TextWrangler to edit it. Sudo worked for me though (not using TextEdit.app).

Link to comment
Share on other sites

I didn't know how to achieve this through Terminal, will come in handy. Thanks. :)

Link to comment
Share on other sites

Terminal all the way for quick hosts file editing

Then a quick reboot or could just flush the cache for 'instant' updating

Link to comment
Share on other sites

Then a quick reboot or could just flush the cache for 'instant' updating

Does OS X really cache entries from the hosts file? Seems weird to me.

Link to comment
Share on other sites

Still doesn't really explain why he can't use TextMate to edit the file anymore...?

TextEdit, not TextMate. You can still use TextMate just fine. The problem probably has something to do with sandboxing in Lion.

Link to comment
Share on other sites

Terminal all the way for quick hosts file editing

Then a quick reboot or could just flush the cache for 'instant' updating

You don't need to reboot LOL's

Link to comment
Share on other sites

TextEdit, not TextMate. You can still use TextMate just fine. The problem probably has something to do with sandboxing in Lion.

Ahhh crap, I misread. Thanks.

Link to comment
Share on other sites

  • 4 months later...

There's an application called Gas Mask that can edit the Hosts file on the Mac quiet easily - even allow for subscriptions to anti-malware and adblock Hosts files from this site: http://winhelp2002.mvps.org/hosts.htm.

Gas Mask is available here http://www.clockwise.ee/gasmask - it also has a Google Code page here: http://code.google.com/p/gmask/

Link to comment
Share on other sites

There's an application called Gas Mask that can edit the Hosts file on the Mac quiet easily - even allow for subscriptions to anti-malware and adblock Hosts files from this site: http://winhelp2002.mvps.org/hosts.htm.

Gas Mask is available here http://www.clockwise.ee/gasmask - it also has a Google Code page here: http://code.google.com/p/gmask/

I've just realized that I 'double recommended' the Gas Mask application. An oversight on my part.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.