Restore the HOSTS file Windows 8. The contents of the hosts file. What you need to change and how it should be

The Windows 7 operating system has such a file by which you can adjust the visits to sites on the Internet. Mostly people do not know about such a file, and those who know, they try to ignore him, so that they do not "do miracles." This file is called hosts. We'll figure it into brief, why is it needed.

May you know that registering in the browser line address of any site, a special DNS server that is on the Internet, it immediately changes to a certain sequence of numbers. This digital row for each site is unique, and the names of the sites are needed only for ease of memorization. Hosts file is used to quickly work in the worldwide Internet, bypassing requests to DNS Server. In other words, if you write a digital row in the HOSTS file, corresponding to the site name, then you will be taken directly to it, bypassing the DNS server. Just prescribing you need correctly, and then the site will not boot, if it is loaded, then not the one that I would like.

"Computer pests" willingly use hosts file In personal interests. The virus, penetrating the computer, very often changes the HOSTS file. Consequently, if suddenly you are faced with restricting access to those or other sites, the first thing is to scan the computer, perhaps the viruses were settled in it, and only then convert Hosts to the original appearance.

Where is the HOSTS file in Windows 7?

So, consider in Windows 7 where Hosts is located. You can find it in the Windows system folder. It is placed on the disk with, that is, where the system is installed. Next, we find the "System 32" folder, go to "Drivers" and, finally, in Etc. In this folder and the file you need is saved.

It happens that you did not find the HOSTS file, most likely it is simply hidden and the settings "Do not show hidden files, folders and discs. " In this case, you need to open the folder "Computer" and press "Alt", an additional menu will appear at the top of the window, select "Service" and "folder parameters".
In a new window, select the "View" tab and find the item "Show hidden files, folders and discs", we put a tick on it. We accept changes by pressing the "OK" button. Now go to the "ETC" folder, the Hosts file should be displayed.

Now consider how you can change the HOSTS file. Let's proceed as follows:


Where is the HOSTS file in Windows 10?

The hosts file in the Windows 10 operating system is located in the same place as Windows 7, that is, on the system disk. In the folder "Windows", then follow the "System 32" folder, go to "Drivers" and, finally, in ETC.

To change the file in Windows 10, you must:

  • Click twice on the Hosts file;
  • In the window, which appeared to find "open with the help";
  • We find among the proposed programs "Notepad";
  • Click "OK";
  • Make amend and save them.
  • If you are a fabric in this matter, do not do anything better, but ask for help from a qualified specialist.
  • If something pushes you to make changes yourself, then before this make a copy of the file and transfer it to another folder. Suddenly you can't do something, you will return a copy of the file back.
  • If you have not copied this file and have already made a change, and then the computer started to clutch, then the Internet will help you. Download from the site a similar file and replace your own.
  • Before changing something to think, do you really need to do it and how important it is for you.

HOSTS file is a pretty vulnerable place in operating system Windows. This file becomes the target number one almost for all virus and trojans, which can be infected with a computer. In this article, we will tell you what the Hosts file is where it is, for which it is used and how to restore it after infection with viruses.

The task of this file store the list of domains and the corresponding IP addresses. The operating system uses this list to convert domains to IP addresses and vice versa.

Each time you enter the address in the address bar of the browser you need a site, a request for a domain conversion to the IP address occurs. Now this transformation is executed by the service called DNS. But, at the dawn of the Internet hosts, the file was the only opportunity to associate the character name (domain) with a specific IP address.

Even now, this file It has a direct impact on converting symbolic names. If you add an add an entry to hosts to a domain IP address, then such a record will work perfectly. This is exactly what the developers of viruses, Trojans and other malicious programs are used.

As for the file structure, the Hosts file is normal text file BUN extension. That is, this file is not called not, hosts.txt, but just hosts. To edit it, you can use the usual text editor notepad (NotePad).

The standard HOSTS file consists of several lines that start with the "#" symbol. Such lines are not taken into account by the operating system and are simply comments.

also in standard File Hosts present recording "127.0.0.1 Localhost". This record means that when accessing the symbolic name Localhost, you will appear to your own computer.

Machinations with Hosts File

There are two classic ways to benefit from making changes to the Hosts file. First of all, you can block access to sites and servers. antivirus software.

For example, infecting the computer, the virus adds In the hosts file such entry: "127.0.0.1 kaspersky.com." When you try to open the site kaspersky.com, the operating system will connect to the IP address 127.0.0.1. Naturally, this is an incorrect IP address. This leads to Access to this site is completely blocked. As a result, the user of an infected computer cannot download antivirus or updates of antivirus bases.

In addition, developers can use another reception. By adding entries to the Hosts file, they can redirect users to a fake site.

For example, infecting the computer, the virus adds such an entry to the HOSTS file: "90.80.70.60 Vkontakte.ru." Where "90.80.70.60" is an IP address of the attacker's server. As a result, when trying to go to the well-known site, the user hits the site that looks exactly also, but is on someone else's server. As a result of such actions, fraudsters can get logins, passwords and another personal information User.

So in case of any suspicion of infection with the virus or on the site submenu, the first thing you need to check the hosts file.

Where is the hosts file

Depending on the version of the operating system Windows file. Hosts can solve in various folders. For example, if you use Windows XP, Windows Vista, Windows 7 or Windows 8, the file is in the Windows \\ System32 \\ Drivers \\ ETC \\ ETC folder.

In Windows NT and Windows 2000 operating systems, this file lies in the Winnt \\ System32 \\ Drivers \\ ETC \\ ETC folder.

In completely ancient versions of the operating system, for example, in Windows 95, Windows 98 and Windows ME, this file can be found simply in the Windows folder.

Restore Hosts file

Many users who are suspended hacking are interested in where you can download hosts file. However, you do not need to search and download the original Hosts file. It can be corrected independently, for this you need to open text editor And delete everything except stitching except "127.0.0.1 LocalHost." This will unlock access to all sites and update the antivirus.

Consider in more detail the HOSTS file recovery process:

  1. Open the folder in which this file is located. In order not to wander around the catalogs in search the desired folder You can use a little cunning. Press the Windows + R keys combination in order to open menu "Run" In the window that opens, enter the command "% Systemroot% \\ System32 \\ Drivers \\ etc" and click OK.
  2. After you open the folder in which the Hosts file lies, make backup current file. In case something goes wrong. If the hosts file exists, simply rename it to hosts.old. If the HOSTS file is not at all in this folder, then this item can be skipped.
  3. Create new empty file Hosts. For this click right-click Mouses in the ETC folder and select item "Create text Document» .
  4. When the file is created, it must be renamed to hosts. When renaming the window will appear in which will be a warning that the file will be saved without expansion. Close the window with a warning by pressing the OK button.
  5. After the new hosts file is created, it can be edited. To do this, open the file using a notepad program.
  6. Depending on the version of the operating system, the contents of the standard hosts file may differ.
  7. For Windows XP and Windows Server 2003 You need to add "127.0.0.1 LocalHost".
  8. Windows Vista, Windows Server 2008, Windows 7 and Windows 8 need to add two lines: "127.0.0.1 Localhost" and ":: 1 Localhost".

The note will be discussed by a "long-suffering" system file. hosts.who often gets from the network "malicious" who leveled to the computer. Hosts. There is no extension, but in essence it is a regular text file and to edit it is enough built-in notebook (NotePad). File task - store a list of domains and the corresponding to them IP-press. This is the list to which the browser is first drawn, after entering in the address bar, say, the domain name Yandex.ru.To find out what corresponds to him 77.88.21.11.

Now imagine that the attacker program replaced in hosts. "Aypishnik" Yandex.ru.on the address you need "weed" site. Now every time after the symbolic set in the browser Yandex.ru. Will you be on some Xxx.com.. Of course, this disgrace you need to quickly stop preventing what you have to contact the file directly hosts.. In the article I wonder the guaranteed way to do this, because in recent versions Windows The developer strengthened the safety of the OS, which in practice complicated the life of users: the desired folder may not be visible or the file itself cannot be edited.

So for bringing hosts. In the "divine" species should open "Notepad" on behalf of the administrator. To do this, go to the menu "Start"→ Next," All programs" → "Standard" → right-click on Notebook and in the context menu whether you choose "Run on the name of the administrator ".

In the top panel of the press " File " → "Open "→ In the address bar, specify the path to the desired folder - C: \\ Windows \\ System32 \\ DRIVERS \\ ETC . In case the folder turns out to be empty, in the "File Name" row hosts. and click " Open "(Next screenshot).

The contents of the file can be compared with the original in Windows 7. And, in case of discrepancies, copy yourself.

# 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. # 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 Handle Within Dns Itself. # 127.0.0.1 Localhost

In principle, you can leave only one entry - 127.0.0.1 Localhost. or even not to leave anything - in any version it is better than the disgrace as in the screenshot below (the actual example of the editorial board hosts. villain virus).

As you can see, "malware" blocked the update of antivirus programs and access to social network sites. In order for the situation to be repeated, it is recommended to protect the file attribute " Only reading"by clicking on hosts. Right-click → " Properties "→ on the first tab" General ", check the daws opposite the corresponding attribute.

About what else useful can be done with system file hosts. I will tell you our.

Hosts file is a fairly vulnerable area of \u200b\u200bthe Windows operating system. This file becomes the target number one almost for all viruses and Trojans, which can be infected with the computer.
The task of this file store the list of domains and the corresponding IP addresses. The operating system uses this list to convert domains to IP addresses and vice versa.

Each time you enter the address in the address bar of the browser you need a site, a request for a domain conversion to the IP address occurs. Now this transformation is executed by the service called DNS. But, at the dawn of the Internet hosts, the file was the only opportunity to associate the character name (domain) with a specific IP address.
Even now, this file has a direct impact on the conversion of symbolic names. If you add an add an entry to hosts to a domain IP address, then such a record will work perfectly. This is exactly what the developers of viruses, Trojans and other malicious programs are used.

As for the file structure, the HOSTS file is an ordinary text file without expansion. That is, this file is not called not, hosts.txt, but just hosts. To edit it, you can use the usual text editor notepad (NotePad).

The standard HOSTS file consists of several lines that start with the "#" symbol. Such lines are not taken into account by the operating system and are simply comments.

Also in the standard HOSTS file there is a record "127.0.0.1 localhost". This record means that when accessing the symbolic name Localhost, you will appear to your own computer.

Machinations with Hosts File

There are two classic ways to benefit from making changes to the Hosts file. Firstly, you can block access to sites and antivirus software servers.

For example, infecting the computer, the virus adds In the hosts file such entry: "127.0.0.1 kaspersky.com." When you try to open the site kaspersky.com, the operating system will connect to the IP address 127.0.0.1. Naturally, this is an incorrect IP address. This leads to access to this site is completely blocked. As a result, the user of an infected computer cannot download antivirus or updates of antivirus bases.

In addition, virus developers can also use another reception. By adding entries to the Hosts file, they can redirect users to a fake site.


For example, infecting the computer, the virus adds such an entry to the HOSTS file: "90.80.70.60 Vkontakte.ru." Where "90.80.70.60" is an IP address of the attacker's server. As a result, when trying to go to the well-known site, the user hits the site that looks exactly also, but is on someone else's server. As a result of such actions, fraudsters can get logins, passwords and other personal information of the user.


So in case of any suspicion of infection with the virus or on the site submenu, the first thing you need to check the hosts file.

Malicious masks the modification of the hosts file in the following way:

To make it difficult to detect strings added by the virus, they are written to the end of the file.

After an extensive empty area formed as a result of repeated row translations;

After that, the original hosts file is assigned a hidden attribute (default hidden files and folders are not visible);

A false hosts file is created, which, unlike this HOSTS file (not having an extension), has an extension. TXT (default for registered extension file types are not displayed):

Where is the hosts file

Depending on the version of the Windows operating system, the HOSTS file can be solved in various folders. For example, if you use Windows XP, Windows Vista, Windows 7 or Windows 8, the file is in the folderWindows \\ System32 \\ Drivers \\ ETC \\


In Windows NT and Windows 2000 operating systems, this file lies in the folder WinNT \\ System32 \\ Drivers \\ ETC \\


Editing the Hosts file

You can edit the file hosts. And in notepad, remove unnecessary lines, or add your own.
In order to edit the HOSTS file, you need to start a notebook in the administrator mode, and then open the C: \\ Windows \\ System32 \\ Drivers \\ ETC \\ HOSTS file already in it.

How to clean the hosts file

So, on points.

Press "Start".

Choose "All programs".

Then choose the item "Standard".

At the point "Notepad" click right mouse button and choose item "Run on the administrator".

In the notepad window that opens, select the File menu, then item "Open..."

In the window that opens, select "Computer" in the left side of the window.

Then open the disk FROM:.

Windows directory.

System32 directory.

DRIVERS catalog.

Catalog ETC.

When you open the ETC directory, you will open an empty directory. In the lower right corner of the window, select "All files".

Select HOSTS file and click "Open".

Check for the presence of the necessary content: at the beginning there are explanatory comments from Microsoft about what is for the file and how to use it. Then a few examples are given, how to enter various commands. All this, simple text and no functions he carries! We skip it and reach the end. The teams themselves must go further. Unlike commenting (i.e., simple text) they must begin not from the icon "#", and with concrete numbersdenoting the IP address.

Malicious can be any commands that are in your hosts file after the following lines:

  • In Windows XP: 127.0.0.1 Localhost.
  • In Windows Vista: :: 1 Localhost.
  • In Windows 7/8: # :: 1 Localhost

As you can see, HOST files in different operating systems are slightly different.

In order not to clean something too much, you need to know how commands are decrypted. There is nothing complicated here. At the beginning of each team comes digital IP address, then (via space) correlated with him domain nameand after it can go small commentafter the icon "#".

Remember! All teams starting with numbers 127.0.0.1 (with the exception of, 127.0.0.1 Localhos.t.) block access To various sites and Internet services. What exactly, look in the next graph going after these numbers.
Teams having at the beginning any other numbers IP addresses Redirect (Do the redirect) on fraudulent sites instead of official. Which sites have been replaced by fraudulent, just look in each column running after these numbers.
Thus, it will guess will be quite simple, which commands in your hosts-file are malicious! If anything is not clear - look at the screenshot from below.

Consider another time. Many virus teams cunning Internet intruders can be hidden far away at the bottom of the file, so do not be lazy to scroll down the slider down to the end!

After you spend the "stripping", do not forget to save all changes ( "File" --> "Save"). If you have opened the Hosts file from the Notepad program itself, when saving changes, in the column "File type" Be sure to select Option "All files"otherwise the notepad instead of saving in the hosts file will make only it text copy Hosts.txtwhich is not a system file and does not fulfill any functions!

After successful save, do not forget to restart the computer.


How to block sites in hosts

So, the hosts file is already open and you see that it is built in the form of a regular text document.

At the beginning you will see comments (ordinary text that is not carrying no functional), starting with the symbol "#" . Following them can go some functional teams prescribed by the system.

But we do not need them. We skip them and reach the very end of the document. We make an indent. And here, here, you can already prescribe the commands we need!

Upon completion of working with the file, open the File menu, select "Save".


To understand how to correctly enter web resource blocking commands, you need to know that each PC has its so-called. LOOPBACK addresssending any request back to yourself. For any computers running windows systems, Linux or Mac This address is always the same - 127.0.0.1 . Here, with the help, just this IP address, you can block any request for an unwanted site so that it is not sent to the requested resource, but about marriage to the local computer.

This command in Hosts is prescribed as follows: " 127.0.0.1 Blocked domain name ". Here real examples: 127.0.0.1 Mega-porno.ru., 127.0.0.1 Odnoklassniki.ru., 127.0.0.1 vk.com. etc.

That's all. Now access to all undesirable sites is reliably blocked. The main thing, after the changes made - to recover the HOSTS file! Detailed instructions See above.

Restore Hosts file after viral infection

As already mentioned, today a large number of malicious programs use the file hosts. To block access to websites of popular portals or social networks. Often, instead of blocking sites, malware redirects the user to pages, externally similar to popular resources ( social networks, mail services etc.), where the inattentive user enters the credentials in such a way to attackers.
If there are type records in the file 127.0.0.1 Odnoklassniki.ru. 127.0.0.1 vkontakte.ru. or addresses of your sites that you cannot go, then for starters check your computer on "malware", and then restore the file hosts.

Many users who are suspended hacking are interested in where you can download hosts file. However, you do not need to search and download the original Hosts file. It can be corrected independently, for this you need to open a text editor and delete everything except the line except "127.0.0.1 Localhost". This will unlock access to all sites and update the antivirus.

Consider in more detail the HOSTS file recovery process:

1. Open the folder in which this file is located. In order not to wander around the catalogs for a long time in search of the desired folder you can use a little cunning. Press the key combination Windows + R. In order to open the menu "Run". In the window that opens, enter the command "% Systemroot% \\ System32 \\ Drivers \\ etc" and click OK.

2. After that, the folder in which the HOSTS file lies in front of you.

3. Next, you need to make a backup of the current file. In case something goes wrong. If the hosts file exists, simply rename it to hosts.old. If the HOSTS file is not at all in this folder, then this item can be skipped.


4.Create a new empty hosts file. To do this, right-click in the ETC folder and select item."Create a text document"

5. When the file is created, it must be renamed to hosts. When renaming the window will appear in which will be a warning that the file will be saved without expansion. Close the window with a warning by pressing the OK button.

6. After the new hosts file is created, it can be edited. To do this, open the file using a notepad program.

7. Depending on the version of the operating system, the contents of the standard hosts file may differ.

This is how everything should look, without exception, "clean" files Hosts.

Note!

  • For Windows XP and Windows Server 2003 you need to add "127.0.0.1 LocalHost"
  • Windows Vista, Windows Server 2008, Windows 7 and Windows 8 need to add two lines: "127.0.0.1 Localhost" and ":: 1 Localhost"

If you ever find the missing or, on the contrary, unnecessary records, then it is better to delete them faster. Especially if they are not done by or without your consent. Most likely, this is the result of the work of viruses!

Restore Hosts File Default in Windows 7: Copy the text below.

# 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

Save and close the file.

Hosts. - A text file responsible for blocking, redirection and in general access to certain Internet nodes.

It is through Hosts fraudsters block access to certain sites and portals. Often redirect to other pseudo pages (alleged classmates or in contact), where they are asked to enter your username and password, and then also sms. As a result, the scamuses have your account data plus money for SMS. More often check the computer to viruses and.

Where to find the HOSTS file (hosts)?

HOSTS file (hosts) is located at:
system Disk (Most often C:) / Windows / System32 / Drivers / etc / hosts
Also in this folder you will find such files as: lmhosts, Networks, Protocol, Services - their presence is normal.

HOSTS file (hosts) disappeared, what to do, where to look?

He did not disappear. Most likely he is simply hidden and in order to see it, you need to enable in the settings. To do this, press the start-up-setting panel of the folder folder-to-at the bottom to put the "Show hidden files, folders and discs" and press apply. Now we are looking for the file there.

How should the Hosts file look like (hosts)?

Just as in the picture may be in English. If there are additional redirects below 127.0.0.1 Localhost, remove all. Here