hosts file


Also found in: Dictionary, Medical, Wikipedia.

hosts file

(networking)
A text file on a networked computer that was used to associate host names with IP addresses. A hosts file contains lines consisting of whitespace-separated fields giving an IP address followed by list of host names or aliases associated with that address. The name resolution library software can use this file to look up the IP address for a host name. The hosts file is "/etc/hosts" on Unix and "C:\Windows\System32\drivers\etc\hosts" or "lmhosts" on Microsoft Windows,

Hosts files have now been almost entirely replaced by DNS, in which distributed servers provide the same information. A hosts file can still be used to override DNS for testing purposes or other special situations.

HOSTS file

A text file in a TCP/IP network that specifies the IP addresses of computer names and domain names. It is used to convert a request by name to a numeric IP address on the local network or the Internet.

Testing and Quick Retrieval
HOSTS files are used to override the DNS system 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 website can be retrieved more quickly, because the multiple transmit/receive steps a normal DNS query takes have been eliminated. See DNS.

Denying Access to Websites
websites can be denied access from a computer if the URLs of those sites are added to the HOSTS file and directed to the loopback address of 127.0.0.1. For example, the following entry in a HOSTS file prevents users from reaching YouTube or eBay.

  127.0.0.1   www.youtube.com
  127.0.0.1   www.ebay.com


HOSTS File Locations
In Windows, the HOSTS file is in the \windows\system32\drivers\etc folder. In the Mac, it is in /private/etc. The first line of a HOSTS file contains the following. See localhost.

  127.0.0.1   localhost
References in periodicals archive ?
These addresses are hard-coded to bypass the hosts file and cannot be prevented from connecting.
Most SMEs use operating systems which control IP address through Hosts file of the operating system before controlling IP address, (like Windows operating system).
The worm includes backdoor functionality to do any of the following: send emails, download updates, participate in denial-of-service attacks, steal passwords, disable anti-virus products and modify a system HOSTS file.
It then installs a 'Google' toolbar (which does not come from Google but has been created by a third party), and modifies the HOSTS file.
By modifying the hosts file, when the users try to access Google, they are redirected to a page that is exactly the same as Google, but not controlled by the company, which is hosted in a server in Germany.
It then modifies the Hosts file so that every time users try to open either the MSN or Netscape search site, they are re-routed through the IGetNet servers.
To do this, the worm modified the HOSTS file on the computer so that when users try to access Google, they are redirected to a page that is exactly the same as Google, but not controlled by the company, which is hosted in a server in Germany.
Recently featured in PC World magazine, Legion(tm) will look up an IP address for you and put it in your Hosts file, and categorize it too.
It then modifies the HOSTS file, creating hundreds of entries corresponding to the banking institutions that it wants to control.
Besides, it modifies the HOSTS file to prevent access to certain web pages.