Wikipedia:

hosts file

The hosts file is a computer file used to store information on where to find a node on a computer network. This file maps hostnames to IP addresses. The hosts file is used as a supplement to (or instead of) the domain name system on networks of varying sizes. This file is (unlike DNS) under the control of the user who is using the computer.

History

The ARPANET (predecessor to the Internet) had no domain name system for giving network nodes their own addresses. Because there was no centralized system for this purpose, each network node contained its own “map” of the network nodes that it needed to know about, and assigned them names that were memorable to the user. There was no system for ensuring that all systems on a network were called the same thing, nor was there a way to read some other user’s hosts file to automatically obtain their copy.

The small size of the ARPANET permitted hosts files to be used with some convenience for some time. Network nodes typically had one address, and could have potentially many names. As individual TCP/IP computer networks started becoming popular, however, the hosts file became a large burden on system administrators — networks and network nodes were being added all the time — making maintenance of the hosts file a task which grew significantly.

Location and default content

The host file is located in different locations in different operating systems and even in different Windows versions.[1]:

  • Windows NT/2000/XP/Vista: %SystemRoot%\system32\drivers\etc\ is the default location, which may be changed. The actual directory is determined by the Registry key \HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath.
  • Windows 95/98/Me: %WinDir%\
  • Linux and other Unix-like operating systems: /etc
  • Mac OS: System Folder: Preferences or System folder (format of the file may vary from Windows and Linux counterparts)
  • Mac OS X: /private/etc (uses BSD-style Hosts file)
  • OS/2 and eComStation: "bootdrive":\mptn\etc\

In Windows, the default hosts file is often blank[2] or it contains (inactive) comment lines followed by the single entry

127.0.0.1        localhost

An example can be found at [3].

Other uses for the hosts file

The hosts file has alternative uses, including filtering ads by having entries for known ad-servers redirect to machines without the advertising on them or more typically by redirecting references to ad-servers to the local address 127.0.0.1. This can save network bandwidth, as well, by eliminating a request to the DNS server normally used for obtaining address information, as well as by not downloading the advertisements. However, if the hosts file is to be used for this purpose, it must be kept up-to-date with lists of Internet servers known to host such content.

A more important use of the hosts file is to block known dubious or criminal domains and servers (with spyware and other malware) in the same manner used for blocking ad-servers[4].

The hosts file can also be "hijacked", or used for malicious purposes. For example, adware, computer viruses, trojan horses, or other malware can edit the hosts file (particularly on Windows-based systems) to redirect traffic from a "safe" site (such as Google or Wikipedia) to sites hosting content that may be offensive or intrusive to the user or the user’s computer system. For example, a trojan (Qhosts) redirected traffic from search engines such as Google and AltaVista to a site specified by the author of the trojan horse[citation needed]. Mydoom.B (a malware program) blocked users from visiting sites regarding computer security and antivirus software, which also affected the Windows Update web site.

See also

References and footnotes

    External links

    Custom hosts files
    Applications to Manage Hosts Files

     
     
     

    Join the WikiAnswers Q&A community. Post a question or answer questions about "hosts file" at WikiAnswers.

     

    Copyrights:

    Wikipedia. This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "Hosts file" Read more

    Search for answers directly from your browser with the FREE Answers.com Toolbar!  
    Click here to download now. 

    Get Answers your way! Check out all our free tools and products.

    On this page:   E-mail   print Print  Link  

     

    Keep Reading

    Mentioned In: