Edit hosts file on a mac

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!

About Author

Related Posts

can't set locale

Can’t set locale; make sure $LC_* and $LANG are correct!

Can’t set locale; make sure $LC_* and $LANG are correct! This suddenly appeared on all my servers one day after some updates. All of them were running…

Xcode 9 iOS icon sizes

Xcode 9 iOS icon sizes overview

Xcode 9 iOS icon sizes overview Xcode 9 iOS icon sizes overview. They keep adding more and more icon sizes. Xcode 9 has the most icon sizes…

how to uninstall unity

How to uninstall Unity on Mac

How to uninstall Unity on Mac This is how to uninstall Unity on Mac. Follow these simple steps and delete the following folders or files. 1. /Applications/Unity…

Xcode 9 uiimage image not shown

Xcode 9 uiimage image not shown

Xcode 9 uiimage image not shown Working on some ios apps created with Xcode 8 and your images don’t show after upgrading to Xcode 9? Took me awhile…

how to find minecraft on mac

How to find minecraft on mac

How to find minecraft on mac How to find minecraft on mac is quite easy. There is two places you need to look. The Minecraft game itself…

Xcode 8 iOS icon sizes overview

Xcode 8 iOS icon sizes overview Xcode 8 iOS icon sizes overview. There are even more icon sizes since Xcode 7. And it can be an extra challenging…

Leave a Reply