The hosts file is one of the significant network files of any function arrangement. We all know about DNS, which maps I.P. address to a sphere address. For case, when you type in your browser URL, your internet connection queries DNS system of your I.S.P. to find the I.P. address and thus serve web site in your browser .
This besides brought the concept of Public DNS, which I have already discussed in detailed earlier ( Using Google DNS to speed up The internet ). similarly, Hosts file is for your local computer .
You can add custom detail in your Hosts file, and before checking DNS, your system will check operational arrangement hosts file for any character. For exercise, if you add I.P. address for domain in your bone Hosts file, when ever person will type in the browser URL, will be open in the browser. ( A great idea for prank excessively ). Anyways, I will not get into detail explanation of DNS and Hosts file, but if you are interest to learn these basics ( you should ), here are few articles for your mention :

Editing Hosts file in Mac using Nano:

At the time of writing this article, I ’ m using Mac 10.8.4, and whenever I try to edit the hosts file using Text editor, I see the Locked error. I couldn ’ deoxythymidine monophosphate find any option to unlock the Hosts file, and edit it using Mac Text Editor. here is the error that I got, while trying to edit hosts file :

You don’t own the file “hosts” and don’t have permission to write to it.
Locked hosts file in Mac
This is the default placement of hosts file in Mac OS X :


And, here is the way to edit the file. candid terminal and type this command :

sudo nano /private/etc/hosts

And it will ask your system password once you enter the password, you will see a screen like this :
Nano hosts file terminal editor

Nano is the terminal editor program, and if you wish to learn all the commands of this editor program, here is a handy reference point. nowadays, use your cursor to move, and edit the hosts file according to your necessity. Once you are done making changes, pawl on

  • Ctrl+ 0 : Click Enter after that. (This will save your output)
  • Ctrl + X: This will exit the Nano editor.

update : You can download this Mac app call Gasmasks to edit hosts file promptly .
It took me 15 minutes to find the solution to lock hosts file issue in Mac, and I hope this article will save your cherished meter. If you are still stuck or have any interrogate, feel free to ask me via comments. Do check out our other articles on general-tech, and you will learn something new today.

Leave a Reply

Your email address will not be published.