HOSTS File is a simple text file in Windows & Mac OS X that is used to map Hostnames to IP Addresses. When you type any URL in your browsers search bar then it checks whether there is any relevant entry in the HOSTS file and gets you the corresponding IP address, else it resolves that IP using the active connections DNS Servers. Another use of HOSTS file is to block the few Hostnames i.e if you are giving Internet access in schools or colleges or to any of your employees in your business premises, then you can block certain sites.
Editing HOSTS File in Windows Computer
If you are using Windows Computer the we are going to tell you how you can edit your HOSTS file to add few line and blocking sites from getting accessed, its also useful to cracking few software's, as we can block there servers from accessing the software and checking if serial key entered is legit or not.
- Open Notepad as Administrator.
- Navigate to C: > Windows > System 32 > drivers > etc
- Choose “All Files” from below and then double click on the HOSTS file.
- Now you will have the file live in the above image, you can add all the lines.
- Like you can see I have added Corel Lines to block Corel from Accessing Software.
So you can add all those lines that you want to stop from accessing your computer and software, it all depends on you, so this is the way you can access HOSTS file and alter it, make sure you open it as Administrator else it won’t let you Save the file.
Editing HOSTS File on Mac OS X - Leopard
If you are on Mac OS X - Leopard then you can follow steps mentioned below to Alter your HOSTS File, its quiet simple, so follow all the steps carefully.
- Open the Terminal.app, you can find Terminal app by searching “Terminal” in your spotlight or you can navigate to Applications > Utilities > Terminal.
- Now you need to enter below line to access the HOSTS file from your Terminal.
$ sudo nano /private/etc/hosts - If you prompted to enter the password, enter your password.
- Now you will have the HOSTS file opened, you can Alter that like I have explained above, add lines and modify the one you want. It all depends on the instructions.
- After you have made all the changes simply Save your HOSTS File.
- Now you need to Flush the DNS Cache, its pretty simple in the same Terminal app you need to enter below line to Flush your DNS.
$ dscacheutil -flushcache - Now you have successfully altered your HOSTS File.
So guys now you successfully learned how you can edit or alter your HOSTS file on both Windows and Mac OS X, so try it yourself and remember this will be useful in many cases and in many of my posts, I usually tell you to alter your HOSTS file in order to make many software's full version.
(COMMENTS WILL LOAD AUTOMATICALLY)