Host files are the files used by Microsoft TCP/IP for windows. It shows the mapping of the IP address with its corresponding Host name. It helps to access any web site or web page easily. Mapping the IP addresses with their Host names also help to resolve DNS issues.
DNS is responsible to map or access a web site. It translates the host name or the web site name to its corresponding IP address, thereby providing access to the respective web site or web page. If there is any problem in the DNS, the communication to any web page becomes difficult.
The host files map the IP address to its Host names thereby making the DNS lookup easy. If you specify any IP address and its corresponding host name, the work of DNS becomes simpler, thereby making the lookup faster, and the web site can be accessed more easily. Host files can also be used to block any web site on your system. Here, the web site name is specified and a default IP address is set to it. Now, whenever a user tries to access this website it is not located by the DNS.
Host files are generally READ ONLY, in other words you cannot modify them in general. To edit a host file, you need to remove it from READ ONLY constraint and then move it anywhere else to edit it. It can be edited using NOTEPAD.
Path to Host File
C - > Windows - > System32 - > drivers - > etc - > hosts
To edit the host file:
- ■Log on to Windows with administrator account.
■Browse to the above location.
■Right-click the host file and from the drop down menu click on Properties.
■Uncheck the READ ONLY checkbox. You will be needed to provide administrator permission to perform this task.
■Now copy this file to some other location on your computer.
■Open the copied file in Notepad.
■In the opened file, go to the bottom and add a new line specifying the IP address of the trusted website followed by its corresponding URL.
■Finally save the file.
■Paste the file back at its original location.
■Restart the computer to allow the changes to take effect.
Note: Using the above tweak, you can also block any site on your system. All you need to do to block a website is to type IP address 127.0.0.1 followed by the URL of the unwanted website, and restart the computer to allow the changes to take effect.