Hosts file

4/1/2015·1 min read

With changing hosts file, you can mapping specific hostname to point to your own ip address, or let hostname to point to specific ip address at your current computer. For example, I want to point to my local machine will be following.           localhost

Another example, I want to host name to point to ipaddress

Following are comment from Microsoft.

 This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. 

From windows hosts file comment

after you changed hostname to point to specific ip address, you might have to type ipconfig /flushdns at command line.


ipconfig from microsoft
Linux hosts file