What is a host file?
==============================
The simple answer is: the host file is like an address book. when you type a URL in your browser, the host file will be queried to see if you have set an IP address for that site. if you set it, your computer will use this IP address to open the site. if no, the computer will go back to your Internet Service Provider (ISP) computer to find the IP address. most of the time, there will be no IP addresses in the host file. most of the time, the computer queries the ISP to obtain the IP address.
The longer answer is: windows and other operating systems use the host file to map the Host Name and IP address.
The following steps are required to find the IP address corresponding to the Host Name:
First query your local host file. the host file will tell you the IP address corresponding to the Host Name of your computer, so that your computer will stop querying and directly open the site. however, if it cannot be found, it will ask the DNS server for information.
Host File Location
==============================
Windows 95/98/me
C: \ windows \ hosts
Windows NT/2000/XP Pro
C: \ winnt \ system32 \ drivers \ etc \ hosts
Windows XP Home/Windows 7/Windows Server 2008
C: \ windows \ system32 \ drivers \ etc \ hosts
Note:
Host is the name of the file, not the name of the folder. There is no extended name for this file (for example, .exe,. txt,. Doc, etc)
If you do not have a host file, you can create one by yourself and put it in the folder listed above.
Note:
If you find that you already have the host file, we recommend that you back up it and copy it to another hard disk partition so that you can recover it.
Host file example
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample hosts file used by Microsoft TCP/IP for Windows.
#
# This file contains the Mappings of IP addresses to host names. Each
# Entry shoshould be kept on an individual line. The IP address shold
# Be placed in the first column followed by the corresponding host name.
# The IP address and the host name shocould 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.
#
# For example:
#
#102.54.94.97 rhino.acme.com # source server
#38.25.63.10 x.acme.com # X client host
# Localhost name resolution is handled within DNS itself.
#127.0.0.1 localhost
#: 1 localhost
127.0.0.1 alternative80
Http://accs-net.com/hosts/what_is_hosts.html
Http://accs-net.com/hosts/how_to_use_hosts.html
Http://en.wikipedia.org/wiki/Hosts_file