I’ve been using TextWrangler for years to do this.
Know of another trick to modify the Mac hosts file in an easy fashion through TextEdit or another GUI app? Let us know in the comments. That method will not work in the latest releases, however, thus you’ll want to rely on the open command instead. Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts
Macbook textedit app mac os x#
While the aforementioned approaches work in all modern versions of Mac OS X, earlier versions of Mac OS X can also launch the TextEdit binary with hosts directly from the command line with the following syntax: The trick is largely the same as Text Edit, still requiring the use of sudo, but changing the specified application name as follows. Users can also choose to modify Mac OS X’s /etc/hosts with TextWrangler, BBEdit, or another third party application.
Macbook textedit app how to#
You’ll likely want to clear out your DNS cache after modifying the hosts file, here’s how to flush DNS in Mac OS X El Capitan and modern versions Mac OS and how to do the same in prior releases. It’s also a good idea to set plain text mode as the default for TextEdit. It’s good practice to make a duplicate of the hosts file so that if you break something you can easily fix it, though we’ve got the original default hosts file here in case you need to restore it. This is necessary for modern versions of Mac OS X, though you can choose to edit the hosts file using the command line with nano as described here without adjusting SIP. You can turn off SIP in Mac OS X with these instructions, which requires a reboot of the Mac. * If the hosts file shows as “locked” and won’t save changes despite being launched through sudo, it’s likely because you didn’t disable SIP as mentioned in the introduction. Quit out of TextEdit, then quit out of Terminal when finished.The /etc/hosts file will launch into TextEdit as a plain text file where it can be edited and modified as need be, when finished use File > Save or hit Command+S as usual to save the changes to the hosts document *.