A text file in a TCP/IP network that specifies the IP addresses of computer names and domain names (the host names). It is used to convert a request by name to a numeric IP address on the local network or the Internet. HOSTS files, which contain a host name and corresponding IP address on each line, were placed on clients and servers and manually updated.|
HOSTS files have long since given way to the DNS name resolution system; however, they are still used to override DNS for testing purposes so that a Web browser or other application can be redirected to a specific IP address. In addition, by explicitly stating an IP address in a HOSTS file, a Web site can be retrieved more quickly, because the multiple transmit/receive steps a normal DNS query takes have been eliminated. See DNS.
HOSTS File Locations
In Windows, the HOSTS file is typically in the \windows\system32\etc folder. In the Mac, it is in /private/etc. The first line of a HOSTS file is 127.0.0.1 localhost. The "localhost" refers to the computer the HOSTS file is in, and the "127.0.0.1" is the loopback IP address of that same computer (see loopback address).