Using a Hosts File for Name Resolution

In the old days, hosts files were the primary means of performing IP address to name mappings. Today, DNS is used to perform this function. However, Windows still supports the use of hosts files if you wish to use them to supplement your DNS records. A hosts file exists in the %systemroot%\system32\drivers\etc directory. You can edit this hosts file and add your own entries.

Here’s how to edit the hosts file:

  1. Open the hosts file using notepad.

  2. Place your entry below the localhost entry in the hosts file, as shown in Figure 8-12.

  3. Save and close the hosts file.

    click to expand
    Figure 8-12: The Hosts file

There are two fields that make up an entry in the hosts file: the IP address and the fully qualified domain name that corresponds to that IP address. These two items are all you need to make name resolution work.




IIS 6(c) The Complete Reference
IIS 6: The Complete Reference
ISBN: 0072224959
EAN: 2147483647
Year: 2005
Pages: 193

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net