hosts file

Hosts File is a text file that provides a local method for resolution of fully qualified domain names (FQDNs) into their respective IP addresses on a TCP/IP network.

What is Hosts File?

A text file that provides a local method for resolution of fully qualified domain names (FQDNs) into their respective IP addresses on a TCP/IP network. Hosts files are an alternative to DNS servers for name resolution on TCP/IP networks. They are used mainly on small networks or when maintaining a DNS server is impractical.

What is Hosts File?

You can locate the hosts file using the following paths:

  • Microsoft Windows NT or Windows 2000:
    %SystemRoot%\system32\ drivers\etc\Hosts

     

  • Microsoft Windows 95 or Windows 98:
    \%WinDir%\Hosts.sam

     

Each line in the hosts file contains the IP address of a TCP/IP host followed by the FQDN of the host, followed by an optional comment prefixed with a pound sign (#).

NOTE

Hosts files should contain mappings for hosts on both local and remote networks. Mappings can consist of an IP address and one or more host names (aliases). If you are using hosts files to resolve host names on a network, each computer on the network should have a hosts file.

TIP

Place the host names that need to be most frequently resolved near the top of the hosts file, because the file is parsed linearly from the beginning.