Hosts - what should be there? Hosts File

Computers

Operating system (OS) Windows (as well as otherOS) has the ability to accelerate the transition to the IP address you typed in the address bar of the site without contacting the Domain Name System DNS - DomainNameSystem. For this purpose, a special operating system file called hosts is used (it is used without any extension). The question arises: "File hosts - what should be there?"

hosts that there should be
hosts that there should be

What is needed and what does the hosts file contain?

If this file specifies a name matchsite to its actual IP address, the redirection occurs without contacting your ISP's DNS service. Hosts file is a plain text file that can be opened by any text editor, for example "Notepad" (but requires administrator rights). By default, the file contains several lines of explanations (comments) in English or Russian and a single executable line that provides redirection to the IP address of the computer itself of calls to the localhost name.

Where the hosts file is located

Usually the hosts file can be found:

  • in Windows 95/98 / ME versions - in the WINDOWS directory;
  • in Windows versions of NT / 2000 - at WINNTsystem32driversetc;
  • file hosts Windows 7 (and versions of Windows XP / 2003 / Vista / 8) - in the directory WINDOWSsystem32driversetc.

Other operating systems also have a hosts file with similar functions. Where the hosts file in these OS is located, it is necessary to consider separately.

Why the virus protection file is important

The importance of addressing the issue of hosts, what shouldbe that the special properties of this file some malware use to protect against anti-virus programs and to block the call of certain files. After all, if you record the redirection of anti-virus programs to a false IP address in the hosts file, then the computer will not be able to run these programs, and, for example, the anti-virus databases will not be updated.

Therefore, if your computer has problems with the operation of anti-virus software, one of the reasons may be unauthorized modification of the hosts file on your computer.

hosts windows 7

What can the hosts file be used for?

Some users use it topreventing the use of certain sites, such as pornographic sites or boring social networks. To implement such a task, you can simply enter at the end of the file for each site one line of type: 127.0.0.1 "site name". At the same time, the sites that users are trying to transfer on this computer will simply not be called.
You can do this trick: redirect those trying to invoke an unwanted site to a site, for example, Mashkov's library, by entering the line: 81.176.66.163 "site name".

where hosts file

Exclude ad serving

Also the question of hosts, what should be there, is importantbecause by introducing some additions it is possible to avoid displaying boring contextual and / or banner advertising, which in some sites is added not only along the perimeter of the information content of the pages, but also interspersed in the middle of the texts of articles. To do this, you need to redirect the sites that host these types of advertisements to address 127.0.0.1, as indicated above. And these are such sites, as, for example, "Google" contextual advertising AdSense. To exclude its display, enter the following lines in the hosts file:

  • 127.0.0.1 pagead.googlesyndication.com;
  • 127.0.0.1 pagead2.googlesyndication.com.

And save the file. If you want to view this ad again, you must delete these lines or make them comments by putting the # (grid) character with a space at the beginning of the line.

hosts file

On the Internet you can find ready-made texts forinserting into the hosts file containing many such lines that exclude the display of unnecessary advertising materials. In addition, there are ready-made texts for setting up faster work with some search engines, for example, hosts google. However, you should use these materials carefully. It is not advisable that the size of the hosts file exceeds 10 KB. Otherwise, he himself will slow down the system. Although in these 10 Kbytes you can accommodate a lot of such redirect lines.

Possible difficulties

First you need to make sure that the file you wantedit. The fact is that some cunning virus program creators mask the hosts file used by the system, placing it not in the place where it is registered by default. The system refers to the hosts file Windows 7, whose path is registered in the registry in the parameter DataBasePath, located at: HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesTcpipParameters.

The correct path value looks like this:% SystemRoot% system32driversetchosts. You can check this by calling the regedit.exe registry editor from the Start menu - execute.

If the specified variable contains a different value, you need to restore the value that should be.

Another ploy of malware isthe location in the directory etc along with the hosts file of another file with a similar name, for example host. Be careful, make sure that you check and edit the file that is used by the system.

The third trick is to hide the file forviewing. Just in the properties of the file it is prescribed that it is hidden. In this case, it is simply not visible in the catalog, although it is there. To view it, you must first set the item "Show hidden files". In Windows XP, this option is set in the "View" tab of the "Properties" panel of the "Control Panel" menu. After that, viewing hidden files will be possible, and you can clear the hidden attribute in the properties of this file. At the same time, make sure that the "Read only" flag is set for this file. If set, you can not edit it. You need to uncheck the corresponding field in the file properties panel.

google hosts

The next trick may beuse of a proxy. If manual proxy configuration is set, then hosts file does not work. To fix this, check your browser settings. For example, for Firefox, you need to open "Settings", then "More", then select "Configure" in the "Network" tab. In the menu that appears, if the item "Use system proxy settings" was selected, select "No proxy" and save the settings. But if the item "Manually setting up the proxy service" was selected, and you did not install it, then you need to do more work. First you need to remember the installed proxy address, set the "No proxy" option, save the settings. Then you need to open the Registry Editor, call up the search, insert the stored address and perform a search by deleting the value of your address assigned to them in the found keys.

Simple protection

By the way, in order to prevent malicious programs from changing the settings of the hosts file of your computer, it is useful in its properties to set (after all your changes in it) the attribute "Read Only".

Thus, in this article we have dealt withthe question of Hosts, what should be there, and found out what kind of file it is, where it is located, what functions it performs, how it can harm a computer under the influence of malicious programs, and how to use it for its own purposes.