Hosts empty file what to do. How to clean the HOSTS file. Additional measures and prevention

One of the proposed methods was to check the HOSTS file. Then this question was covered briefly, but now consider it in more detail.

Viral programs very often edit Hosts file, prescribing certain commands. As a result, there may be disappeared access to classmates or Vkontakte (sometimes the user opens the "left" site of VKontakte with a request to send SMS for unlocking a page), the anti-virus will stop updating or connecting to the Internet. It also happens that instead of one site, another is loaded. For example, you open start page Yandex or Google, and an advertising site appears.

In all these cases, the HOSTS file is cleaned. If the reason for the appearance of promotional viruses or blocking access in it, the problem will disappear. You can perform 2 methods: manually and using programs. And below is the instruction on how to fix the HOSTS file by each of these methods.

How to Clean Hosts HOSTS File

Manual cleaning is very simple, and you will now make sure about it.

Click Win + R and copy the line to the window that appears: notePad% Systemroot% \\ System32 \\ Drivers \\ ETC \\ HOSTS. As a result, the notepad will start with the contents of this file.

There is another way to open it:


Ready. This is how the Hosts file should look like:

First are the explanations from the Windows developers, what is the file. Then a couple of examples are given how to properly prescribe commands. Comments are written by conventional text and do not fulfill any actions (this is evidenced by the lattice icon at the beginning of all lines).

But in your case, most likely there will be much more text. And without the lattice icon, of course. For example, so:

Row 127.0.0.1 Closes access to the specified website. In the example above, this is classmates, Meil.ru and Kaspersky portal. If other numbers are spelled there, then it is redirected to some kind of fake site.

To clean the file you want to delete these unnecessary lines. But be sure to see how the original version should look like not to erase anything superfluous.

By the way, sometimes these extra lines are hiding at the very bottom. That is, when the file is opening, it seems that there is nothing, but if you scroll it into the bottom, then you can detect several viral commands.

Then save the changes taken. To do this, press the File notepad - save.

Restart your computer or laptop - and the problem with advertising viruses or blocking sites should disappear. If the reason was in this, of course.

What if you do not have the right to edit the HOSTS file? Copy it to your desktop, delete unnecessary lines, save the changes, and then throw in the same folder with the replacement of the previous version. And then restart the PC.

If the problem has not disappeared, first check whether changes are preserved in the host file. After all, this is a fairly widespread error of inexperienced users.

Instructions are universal for all operating systems, so that its version does not play the role here.

How to fix the Hosts file via AVZ

To do this, AVZ is great - a powerful anti-virus utility that helps clean the PC from viruses and any advertising nonsense. This program will find a file, even if it is hidden or renamed at all. It is free, and you can download it.

To open AVZ, select the shortcut, click PCM and run it on the name of the admin.

Thereafter:


The AVZ utility captures the Host file, after which you will only restart the laptop or computer. All will take 5-10 seconds. Plus, the program works on any OS: Windows 10, 8.1, 7 and XP.

Restoring Hosts File Default

As a bonus, I will give another way - official instructions From Microsoft, how to restore the hosts file. You can get acquainted with it. This option is suitable for those who accidentally deleted the HOSTS file and wants to restore it. The instruction is also universal and suitable for Windows 7, 8 and 10.

Comrades, good afternoon. It seems in November, I already wrote on a similar topic, the article was about. Today we will talk about how to return this file in the initial state. Also, this instruction may need for those who ran into pests and now restores the operating system.

So, everything is quite simple. You must open the HOSTS file, as indicated in the editing instructions. For those who are in the subject, I remind you, the file is located on the next way:

C: \\ Windows \\ System32 \\ DRIVERS \\ ETC \\ HOSTS

And it is necessary to open it text editorrunning on behalf of the administrator.

If you deleted the HOSTS file, then create a simple text file with title hosts.txt, turn on and delete its extension along with the point, leaving just hosts.

To fully correct everything that you or the virus has done, I recommend to do the following:

Click Ctrl + A.In order to highlight the whole text. I have an original file, I will show on it. This is the original document to which we will give today.

By the way, pay attention to the scrolling band. As you can see in the screenshot, it is not involved, since all the lines that are in the document are displayed on the screen. If it is, scroll down the page down if there are lines, it means there is a virus on the computer and you need to pass a pair system good antivirus Type Dr.Web Cureit and Kaspersky.

After selecting, delete all the contents of the key Delete..

And insert the following text:

# Copyright (C) 1993-2009 Microsoft Corp. # # This is a sample hosts file Used by Microsoft TCP / IP for Windows. # # This File Contains The Mappings of IP Addresses to Host Names. Each # Entry Should Be Kept On An Individual Line. The IP Address Should # Be Placed in the CorreSponding Host Name. # The IP Address and The Host Name Should Be Separated by At Least One # Space. # # ADDITIONALLY, COMMENTS (Such As These) May Be Inserted on Individual # Lines or Following the Machine Name denoted by A "#" Symbol. # # For example: # # # # # For example: # # 102.54.94.97 rhino.acme.com # Source Server # 38.25.63.10 x.acme.com # X Client Host # Localhost Name Resolution Is Handled Within DNS ItSelf. # 127.0.0.1 Localhost # :: 1 Localhost

Restart the computer and check the file. If new lines were added, then the pest is still on your computer and before re-try to make changes, it is necessary to get rid of it.

Look like that's it. I hope this article has been useful to you, press one of the buttons below to tell about it to friends. Also subscribe to the site updates by entering your e-mail in the field on the right or subscribing to the group in VKontakte and YouTube Channel.

Thanks for attention

Host is a system text file designed to broadcast domain names in the specified network addresses, or IP. It is a kind of special network superstructure, but can be used both in good and malicious purposes. There is a specific category of viruses, modifying the HOSTS file in order to block access to specific web resources (for example, to antivirus offices) or redirect the user to malicious or promotional pages.

Behavior and symptoms of Hosts viruses

Viruses penetrate, like the other "Sorodi", through infected program installers, special boot scripts on web pages and other hacker tricks. Quite often, the installation of "infection" is masked under system errors. A window appears on the screen with a message that the error is supposedly revealed when performing any script or command. Puzzled user, confused, clicks "OK" (no other buttons!) And owns the "doors" by malware into the operating system. The file called hosts is instantly modified, and starts for the user a series of trouble ...

In view of the system works stably - does not slow down, does not hang. But only it is worth the user to open a web browser, all the "hands" crawl out. And they manifest themselves in the following way:

  • when you try to go to social network or what other popular Internet resource an error "Page is not available" appears;
  • the domain (name) of the site is not true: for example, when set in the address bar VK.com opens a page with many advertising banners Or another site, nothing in common with social network.

Many users breathing on the screen one of these paintings, absolutely do not give it values. Soothe yourself with thoughts "This is something there they happened on the server", "Today is a bad Internet" and everything in such a spirit ...

Well, if so. And if the file is infected? Then the problem will not disappear by itself and in an hour, and ten. It is necessary to act: remove from hosts viral modifications, simply speaking, give it the former look.

Treatment of the Hosts file

How to find and what program to open?

Before removing the HOSTS virus, you must first get to it. Open the directory in the specified order (for Windows 7 and XP):

Disk with (or other disk on which OS) → Windows → System32 → Drivers → ETC

It is in the "ETC" directory and is Host. But do not rush to clean it from the computer! It is not deleted, but is treated, and easy. And then, perhaps you are more than once and do not serve a good service (see the last chapter of this article).

Host has no expansion, but contains text information. So you can open it without problems system application "Notepad" and, accordingly, restore the appropriate way.

Let's do that.
1. While in the "ETC" folder, click on the hosts file right-click.

2. B. context menu Select "Open" or "Open with".

3. In the list of programs that you can open the file, click "Notepad" and click OK.

In "Notepad" will appear hosts content. It must be viewed, analyze and remove all viral superstructures.

How to check?

In pure, that is, in "Healthy", hosts, except for lines starting with the "#" symbol, there is nothing more. For a rare only exception, when some trusted programs leave their settings in it.

But when a viral attack occurred, it is necessary to be particularly vigilant.

  • A line with an IP address and domain name of the site (vk.com, ok.ru and others) performs forwarding to another site.
  • A line starting with 127.0.0.1 blocks access to the site.

If such is found, they definitely need to be deleted.

How to clean?

1. Holding the left mouse button, highlight the cursor all the records made by the virus.

2. Right click on the records. Click in the Delete menu.

3. Save the file to make the changed settings entered into force. At the top of the "Notepad" window, click: File → Save.

4. Close "Notepad". Restart OS. Open the browser and check access to sites.

Additional measures and prevention

Unfortunately, it may happen and so that the virus all your efforts to clean Hosts can be reduced to "no" (sites will still be offended). But, nevertheless, the hands should not be lowered.

Advanced the following procedure:
1. Check the disk partitions (system required!) The attending utility Dr.Web Cureit!, Free Anti-Malware or Virus Removal Tool (Kaspersky).

Check in the scan settings antivirus program Checking the boot sectors (MBR), memory, detection of rootkits and turn on high level Detection (detection) viruses.

2. Update the signature bases of the main antivirus that protects the PC from the invasions of malware constantly. Also check its basic settings.

For example, in Anti-Virus Avira, Hosts protection is paid to special attention. In his tuning panel there is special setting "Protect the host file."

What is HOSTS useful?

Hosts enters a group of custom settings and indispensable when solving the following tasks:

Network Lock Connection - Software Application - Server / Website

Many programs are periodically referring to their "native" resources to update, sending data. For the user, this mode of operation is not always convenient: the traffic is spent, the page loading is slowed down, there is no data loading control.

Bye all software settings And the rules of firewall, to limit access to them directly in hosts by adding the following line:

Control over visiting web resources

Similarly, access to certain sites is also blocked: pornographic, dubious, social networks, etc. It all depends on the purpose of the restriction - parental control, Office or training PC.

Host has a priority over DNS servers (services assigning domain name IP addresses), so PC will initially follow its instructions when creating network connection.

Follow the Host file, configure it correctly, and everything will be "OK" with your PC. Enjoy used internet!

Some terminology

DNS. (eng. Abbreviation from DOMAIN NAME SYSTEM.) - Domain Name Service. Establishes compliance between numeric IP.-press and text names.

DNS. (eng. Abbreviation from DOMAIN NAME SERVER.) - the domain name server; service Computer local or Global Network, transferring the names of computers in domain records in.

DNS-Cash (Cache recognizer DNS.) - temporary storage of previous DNS.-Crokes on the local. Reduces the execution time of the query, reduces network and Internet traffic.

host. (eng.) - Home computing machine; Host, any device connected to the network and using protocols TCP./IP..

IP. (eng. Internet Protocol) - Internet protocol; protocol network level From the internet set.

IP address (eng. IP address) - Used to identify a node on the network and to determine the routing information. Consists of a network identifier ( network ID.) and host identifier ( host ID).

Name Resolution (English) - resolution of domain names; The process of converting a computer name to the appropriate.

Name Resolution Service. - Name resolution service; In networks TCP./IP. converts computer names to and vice versa.

TCP / IP. (eng. Abbreviation from TRANSMISSION CONTOCOL / INTERNET PROTOCOL) - Protocol for the management of information transfer, the main protocol of transport and session levels, providing reliable full-duplex flows. Designed for use in the global network and to combine inhomogeneous networks.

URL (eng. Abbreviation from Uniform Resource Locator) - Unified pointer information resource; Standardized string of characters indicating the location of the resource on the Internet.

What hosts.-file

hosts.File B. Windows and others operating systems Used to communicate (match) host names (nodes, servers, domains) with their (name Resolution.).

IN hosts.The default file is registered only one (127.0.0.1) reserved for localhost., that is, for local.

File hosts. It is an ordinary text file (not having an extension).

File disk address hosts.:

Windows 95\98\Me.\\ Windows \\;

Windows NT.\2000\ \ \ – \\ Windows \\ System32 \\ DRIVERS \\ ETC \\.

When the Internet user dials the address in its web browser ( URL) any site (webpage) and clicks ENTER:

- user browser checks in hosts.-File is not the name of the computer's own name ( localhost.);

- If not, the browser is looking for the requested address (host name) in the file hosts.;

- If the host name is found, the browser appeals to the corresponding hostspecified in hosts.-File;

- If the host name is not detected in the file hosts. , then the browser appeals to ( DNS.-cache);

- If the host name is found in the cache, the browser appeals to the corresponding hostsaved in cache DNS.;

- If the host name is not detected in the detector cache DNS., browser appeals to DNS.-servant;

- if the requested web page (site) exists, DNS.-server translates user specified URL-press B. ;

- Web browser loads the requested resource.

History of origin hosts.-File

# Copyright (C) 1993-1999 Microsoft Corp.

#

#

# Space.

#

#

# FOR EXAMPLE:

#

127.0.0.1 Localhost.

# Copyright (C) 1993-2006 Microsoft Corp.

#

# This is a sample hosts file Used by Microsoft TCP / IP for Windows.

#

# THIS File Contains The Mappings of IP Addresses to Host Names. Each.

# Entry Should Be Kept On An Individual Line. The IP Address Should

# Be Placed in the Corresponding Host Name # Be Placed In The First Column Followed by the CRESPONDING HOST NAME

# The IP Address and The Host Name Should Be Separated by At Least One

# Space.

#

# Additionally, Comments (Such As These) May Be Inserted on Individual

# Lines or Following The Machine Name Denoted by A "#" Symbol.

#

# FOR EXAMPLE:

#

# 102.54.94.97 rhino.acme.com # Source Server

# 38.25.63.10 x.acme.com # x client host

127.0.0.1 Localhost.

:: 1 Localhost.

# Copyright (C) 1993-2009 Microsoft Corp.

#

# This is a sample hosts file Used by Microsoft TCP / IP for Windows.

#

# THIS File Contains The Mappings of IP Addresses to Host Names. Each.

# Entry Should Be Kept On An Individual Line. The IP Address Should

# Be Placed in the Corresponding Host Name # Be Placed In The First Column Followed by the CRESPONDING HOST NAME

# The IP Address and The Host Name Should Be Separated by At Least One

# Space.

#

# Additionally, Comments (Such As These) May Be Inserted on Individual

# Lines or Following The Machine Name Denoted by A "#" Symbol.

#

# FOR EXAMPLE:

#

# 102.54.94.97 rhino.acme.com # Source Server

# 38.25.63.10 x.acme.com # x client host

# Localhost Name Resolution Is Handled Within DNS ItSelf.

# 127.0.0.1 Localhost

# :: 1 Localhost

Using hosts.-File

hosts.- File can be used to speed up the global network and reduce traffic - due to reducing requests to DNS.-Servera for frequently visited resources.

For example, you often download resources google.ru. and google.com.. Open File hosts. And after string127.0.0.1 Localhost. enter strings

209.85.229.104 Google.ru.

74.125.232.20 Google.com.

This will allow the web browser not to contact the server. DNS.and immediately establish a connection with sites google.ru. and google.com..

Sometimes hosts.-File use to block unwanted resources (for example, causing and malicious software). For this you need after a line 127.0.0.1 Localhost. Enter a string

127.0.0.1 URL_Blockable_Resurs

The essence of this manipulation is that the blocked resource is compared with 127.0.0.1, which is the address local computer- Therefore, the undesirable resource will not be loaded.

Editing Rules hosts.-File

1. Each element should be located in a separate line.

2. Must begins from the first position of the line, behind it (in the same line) must follow the name of the host.

3. And the node name must be separated at least one space.

4. Comments should be preceded by a symbol. # .

5. If comments are used in lines of compliance of domain names, they must follow the name of the node and separated from it with a symbol # .

Using hosts.File virus writers

The attackers have long been chosen for a long time hosts.-File - with its help, this address of web resources are changed on infected. After that, the web browser redirects the user to the sites with malicious, or, for example, blocks access to antivirus manufacturers sites.

Malicious masks modification hosts.-File as follows:

- To make it difficult to detect rows added by the virus, they are recorded at the end of the file - after a lengthy empty area formed as a result of repeated rows translations;

- after that the original hosts.-File is assigned an attribute Hidden (default hidden files and folders are not visible);

- False is created hosts.-File, which, in contrast to this file hosts. (not having extension) has an extension .txt (By default, the registered types of expansion files are not displayed):


hosts.-File: how to eliminate the consequences of a viral attack

Open hosts.-File (if the virus has set the fileattribute Hidden, required B. Properties of the folder Enable option Show hidden files and folders) ;

- Window appears Windows With a message "Failed to open the next file ...";


- Set the switch Select the program from the manual list -\u003e OK;

- in the window Selection of the program in a scrolling list Programs Highlight Notepad -\u003e OK;

- File hosts. Opened in Notepad;

- Delete all the lines except 127.0.0.1 Localhost.;

- Save hosts.-file.

Valery Sidorov

Good day. Somehow for a long time I wrote an article about the new operating systems. At that moment I somehow did not think about what would you need to write an article about the opposite - how to restore it to the "factory state". The thing is that some "friendly programs" (of course, these are viruses), can change it for themselves and add some useful site to us, say Vkontakte, Yandex, Google or something else ... And after that we get a message that this site is not available in this moment. Of course, this is the most elementary, check the hosts file on excess records, but not every newcomer is guessed about it. Here for such people and this small instruction will be written.

Instruction


  • BUT. Edit the current file using the contents of the content and fill in it as follows:

    # Copyright (C) 1993-2009 Microsoft Corp.
    #
    # This is a sample hosts file Used by Microsoft TCP / IP for Windows.
    #
    # THIS File Contains The Mappings of IP Addresses to Host Names. Each.
    # Entry Should Be Kept On An Individual Line. The IP Address Should
    # Be Placed in the Corresponding Host Name # Be Placed In The First Column Followed by the CRESPONDING HOST NAME
    # The IP Address and The Host Name Should Be Separated by At Least One
    # Space.
    #
    # Additionally, Comments (Such As These) May Be Inserted on Individual
    # Lines or Following The Machine Name Denoted by A '#' Symbol.
    #
    # FOR EXAMPLE:
    #
    # 102.54.94.97 rhino.acme.com # Source Server
    # 38.25.63.10 x.acme.com # x client host

    # Localhost Name Resolution Is Handled Within DNS ItSelf.
    # 127.0.0.1 Localhost
    # :: 1 Localhost