how to edit hosts file on a mac
A short article on how to edit hosts file on a mac. I found an article on how to edit hosts file on a mac. That involved disabling SIP and other complicated stuff. Then I learned it is so much more easy than that.
First step is to download Text Wrangler from Bare Bones Software here http://www.barebones.com/products/textwrangler/
I’m not affiliated with Text Wrangler in any way. Just recommend it because it does a good job on what we are about to do here. I dont recommend TextEdit if you sometimes goes a bit to fast. As you might end up with saving your hosts file as a rtf file or something. Since the hosts file doesn’t have any extention from before.
When Text Wrangler is installed, go to your Finder. The hosts file is located in the /etc folder. But you can’t see that folder from Finder. So when you are in Finder, go to the top menu and select Go -> Go To Folder. Then you type in /etc/ and hit Go.
Once inside the etc folder, right click (or double tap) the hosts file. Select Open With -> Other -> Text Wrangler. When you try to edit the file, the system will ask you if you want to unlock the file. And you want that. If not you are not able to change it.
Once you have done your editing, go ahead and save the file. You will now need to enter your administrator password twice. Only the first time. Because Text Wrangler first ask you if you want to install the helper. The next time you will only need to enter your administrator password once. When the hosts file is save, your new settings are active and you can start using them.
Here is an example of an hosts file from a mac.
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
192.168.1.80 archimedes.home
192.168.1.81 db1.home
192.168.1.83 apt-cacher.home
Thats how to edit hosts file on a mac.
Happy editing!