Using a Hosts file for name resolution in Windows Server 2008

A Hosts file maintains a host table that maps host names to IP addresses. Windows can look up entries in the Hosts file to resolve names without requiring to query a DNS server for resolution. Windows Server 2008 creates a file named Hosts in the \%systemroot%\system32\drivers\etc folder. Hosts is an ASCII file which you can modify in Notepad or any other word processor. The file uses the same format as the Hosts file on 4.3 BSD Unix (stored in /etc/hosts) and by default contains an entry that maps localhost to (which is used for loopback testing and troubleshooting).

Entries in the Hosts file take the format IP Address <tab> host name. You can specify more than one host name for a given IP address, but you must use multiple entries for hosts in different domains, each entry on its own line. Entries in Hosts are case-sensitive, so in the following example, the first two entries enable a correct resolution if the user specifies the host name in either uppercase or lowercase:

You can include a single host name for each entry or specify multiple host names for a single IP address if they fall in the same domain. The following examples are valid entries:

Code:		me	tarzan		you	jane
Each of the entries in this example specifies three host names for each IP address. Windows Server 2008 parses the entries in the Hosts file in sequential order until it finds a match. You can speed up lookup time by placing the most frequently used host-name entries at the top of the file.