Google+ Badge

Tuesday, January 31, 2017

How To Edit Your Hosts File in Windows

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. 

Note : We can modify in different method, here I am choosing below steps.

Step 1 -  Open a Notepad with Run as administrator.

Step 2 - Now we need to go hosts file location and edit the file. 

File Path => C:\windows\system32\drivers\etc\hosts
Step 3 -  Add the IP and Host-name, here I am adding my server address for accessing without DNS entry. We can also block websites using the same procedure.

Step 4 -  Check the connection using ping command with host-name.

Here, my host-name resolved, now I can access my server through IP or Host-name.

That's it...