Langbahn Team – Weltmeisterschaft

Hosts (file): Difference between revisions

Content deleted Content added
4.255.32.253 (talk)
Governa (talk | contribs)
updated Hostsman info from 1.2 to 2.1
Line 68: Line 68:
*[http://datadragon.com/banners/ DataDragon's HOSTS file] Another HOSTS file site, not updated anymore though.
*[http://datadragon.com/banners/ DataDragon's HOSTS file] Another HOSTS file site, not updated anymore though.
*[http://www.aldostools.com/hosts.html Aldo's HOSTS Manager 1.4] simple merge HOSTS file utility
*[http://www.aldostools.com/hosts.html Aldo's HOSTS Manager 1.4] simple merge HOSTS file utility
*[http://hostsman.abelhadigital.com/ HostsMan 1.2] is a freeware application that lets you manage your Hosts file with ease.
*[http://hostsman.abelhadigital.com/ HostsMan 2.1] is a freeware application that lets you manage your Hosts file with ease.
*[http://mywebpages.comcast.net/SupportCD/XPMyths.html#Security HOSTS File Myth] Explains why using the HOSTS file to stop Malware is false security.
*[http://mywebpages.comcast.net/SupportCD/XPMyths.html#Security HOSTS File Myth] Explains why using the HOSTS file to stop Malware is false security.



Revision as of 20:41, 13 November 2005

In computing, a host file, stored on the computer's filesystem, is used to look up the Internet Protocol address of a device connected to a computer network. The host file describes a many-to-one mapping of device names to IP addresses. When accessing a device by name, the networking system will attempt to locate the name within the host file if it exists. Typically, this is used as a first means of locating the address of a system, before accessing the Internet domain name system. The reason for this is that the host file is stored on the computer itself and does not require any network access to be used, whereas DNS requires access to an external system, which is typically slower.

Location

The host file is generally named "hosts" and is located in the following directories for each operating system:

Ad filtering

One use of the host file is ad filtering. This is accomplished by adding a line to the file that maps an ad server's hostname to 127.0.0.1 (home IP) or 0.0.0.0 (no IP). Then, when an internet-capable program attempts to contact the advertiser, its request is rerouted and no advertisement can be loaded. Since no additional programs are necessary to do this, host file based ad-blocking has a near-zero memory and CPU footprint, as well as requiring no loading time.

For example, if you wanted to block Doubleclick ads, you could add the following to your host file:

127.0.0.1 ad.doubleclick.net

or

0.0.0.0 ad.doubleclick.net

Another example, if you wanted to block Google Adsense ads, you could add the following to your host file:

127.0.0.1  pagead.googlesyndication.com
127.0.0.1  pagead2.googlesyndication.com
127.0.0.1  adservices.google.com

or

0.0.0.0  pagead.googlesyndication.com
0.0.0.0  pagead2.googlesyndication.com
0.0.0.0  adservices.google.com

Hijacking

The hosts file can also be used in malicious ways by the authors of Spyware and Viruses. It is similar to ad blocking with the hosts file, but instead of redirecting advertising servers to dummy ones, popular websites are redirected to an advertiser's server. This technique is known as Hijacking. The Qhosts Trojan hijacked many search engines such as Google and AltaVista and redirected them to a site specified by the author.

Other Malware such as Mydoom.B may just block the user from visiting sites about security and the removal of viruses. These sites included the makers of popular anti-virus software and Microsoft's Windows Update page to make the removal of the software more difficult for novice users.

How do you prevent hijacking of the hosts file? The only solution requires realtime monitoring software such as Microsoft AntiSpyware "Hosts Monitor", which will warn you if anything attempts to edit the hosts file. Changing the properties of the hosts file to read-only is completely ineffective. Malicious software can simply change the file's attribute value. Commercial software like ZoneAlarm and Spybot - Search & Destroy have a feature to "lock" the hosts file. This does nothing more than set it to read-only.

Restoration of the host file (Windows and Linux)

When a program hijacks the host file, it may be necessary to restore it.

  1. Identify the location of the host file for your operating system
  2. Create a backup copy
  3. Open it with a basic text editor such as Notepad or vi
  4. Remove all entries for the sites which are hijacked. Some may have been added for legitimate programs. Always be sure to back up your host file. By default, most systems will only have the following line:
127.0.0.1        localhost
  1. Save the file
  2. Restart your computer (Windows)