Contents of the hosts file windows 8. The hosts file

Hello everyone!!! I promise to tell you now a very interesting and useful topic about how you can block or unblock access to such social. networks like Vkontakte and Odnoklassniki.
There are cases when the user does not suspect that his computer was infected with a virus and access to all favorite sites such as Vkontakte, Odnoklassniki or the sites of antivirus publishers were blocked. In most cases, a window appears on the computer of such a user, where it is proposed to send only paid SMS, and sometimes access to your favorite site is simply blocked without any extortion of money and restoration of access.
What to do in this case? How to regain access to your favorite site?

○ first, you need not to panic and in no case send SMS.

○ scan your computer for viruses.

○ clear browser cache, cookie (for Google chrome: configuring and managing Google Chrome => Tools => Deleting browsing data ... ).

○ clear the contents of the hosts file. Here, from this place I will tell you in more detail.

There is way to unblock access to your favorite sites via clearing the hosts file, but cleaning the hosts file will be of little effect if you do not clean your computer from viruses.
So, file cleaning is necessary when the user cannot access the sites Vkontakte, Odnoklassniki and sites of well-known antivirus publishers, etc.

Let's start modifying the hosts file.

1). Open the hosts file.

☻ If your computer has an operating system installed on drive "C", then the path to the hosts file will be as follows:

Find in the folder "etc" hosts file, and open this file with the program "Notebook"

☻ you can open the hosts file in another quick way.

=> for windows 7:

Start => All Programs => Accessories => Run

=> for windows XP

Start => Run

=> or press hotkeys "WIN + R".

You will see such a window as in the image below, where you need to enter or copy into the field "Open" Here's a line:

Click on the "OK" button.
Next, a text notepad will open - this will be your hosts file.

modified hosts file by virus

I circled in red the place to which you need to pay attention: if any sites are registered here (for example, "VKontakte", "Odnoklassniki" or any other), then they are blocked for you, therefore you cannot go to these sites.

2). Change the hosts file to standard content by doing the following:

☻ clear the contents of the old hosts file;

☻ copy the finished standard sample that matches your operating system and paste into a clean hosts file.

I give you ready-made standard samples of the hosts file for windows7 / XP / Vista systems.

☼ Sample hosts file for Windows 7

# 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 name s. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by 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 # :: 1 localhost

☼ Sample hosts file for Windows XP

# 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 first column followed by 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 handled within DNS itself. 127.0.0.1 localhost

☼ Sample hosts file for Windows Vista.

# 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 first column followed by 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 127.0.0.1 localhost :: 1 localhost

Save the file.

3). The picture below shows how a standard non-infected hosts file should look like:

standard hosts file

No site is currently being blocked. If the file is opened in this form, then you have free access to all your favorite sites.

If you saved the modified hosts file, tried to open blocked sites, but there are still no changes, then a virus lives and actively operates in the system, which checks the contents of the hosts file. You need to find a virus and destroy it antivirus program or manually, if you have experience and knowledge.

Attention! There are times when, on the contrary, you need to block access to certain sites (for example, parents do not want their child to visit Odnoklassniki). To do this, again you need to resort to the hosts file.

In order to block the necessary sites, the hosts file must be changed with a virus in the following way:

register these lines, where opposite the numbers write the site you need. For example:

127.0.0.1 vk.com
127.0.0.1 www.odnoklassniki.ru
127.0.0.1 odnoklassniki.ru
each line "127.0.0.1 site address" blocks access to a specific site, except for "127.0.0.1 localhost".

Now, now you know how to unblock or block websites by using clearing the hosts file.

♦ Attention: it may also happen that changes to the hosts file are still not saved, even if you cleaned the viruses. So the problem needs to be fixed in this way:

○ right-click on the hosts file and in the window that opens, click on "Properties".

○ in the Properties window on the tab "General" uncheck the attribute "Only reading".

○ Click on the "OK" button.

After you have corrected this attribute, you will have to repeat all the procedures for editing the hosts file, i.e. go through all the points from the beginning to unblock sites or to block.

If, after the operations done, you cannot save the file in Windows 7, Windows Vista and Windows XP, then try running Notepad as Administrator and editing the file.

Let's say you went to the folder C: \ WINDOWS \ system32 \ drivers \ etc, but you didn't find the hosts file there. What to do?

The hosts file may just have been hidden from your view.
If you are running Windows XP, then do the following so that invisible files are displayed:

○ open folder "etc" "Service" => "Folder properties".

○ Go to the tab "View".
Uncheck the box next to the following items:

- "Hide protected system files"
- "Hide extensions for registered file types"
Now push the switch "Show hidden files and folders ".

○ Click on the "OK" button.

If you are running Windows 7, then do the following:

○ open folder "etc", in the window that opens, click on the tab "Arrange" => Folder and Search Options .

○ Go to the tab "View".
Now push the switch "Show hidden files, folders and drives".
Click the "OK" button.

Now the hidden hosts file is visible for fix.

Also you can try to press hotkeys "WIN + R", and in the field "Open" insert this line:

Notepad% windir% \ system32 \ drivers \ etc \ hosts

If after the above steps there is no hosts file, then create it.

Create hosts file.

How do I create a hosts file?

○ Go to the folder "etc", along the way C: \ WINDOWS \ system32 \ drivers \ etc.

○ right-click on an empty space inside the folder "etc"

○ will open context menu... Please select "New" => "Text Document" .

○ you will have a file named "Text document.txt" .

○ remove the complete name along with the file extension and write just hosts. In the request to change the extension, click on the "Yes" button.

That's all. Your computer no longer blocks the Vkontakte site, classmates or other favorite sites. Its useful to note

Regards WebMasterok2009

Did you like the post? Help others learn about this article by clicking on the social media button ↓↓↓

Get Blog Updates !!! Subscribe:

The hosts file is a rather vulnerable place in the Windows operating system. This file becomes the number one target for almost all viruses and Trojans that manage to infect a computer. In this article, we will talk about what the hosts file is, where it is located, what it is used for and how to restore it after a computer has been infected with viruses.

The task of this file is to store a list of domains and their corresponding ip-addresses. The operating system uses this list to translate domains to ip addresses and vice versa.

Every time you enter the address you need for a site into the address bar of your browser, a request is made to convert the domain to an ip-address. This translation is currently performed by a service called DNS. But, at the dawn of the development of the Internet, the hosts file was the only way to associate a symbolic 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 entry in the hosts file that will associate an ip-address with a domain, then such an entry will work fine. This is exactly what the developers of viruses, Trojans and other malicious programs use.

As far as the file structure is concerned, the hosts file is a regular text file with a buse extension. That is, this file is not called hosts.txt, but simply hosts. To edit it, you can use the usual Notepad text editor.

The standard hosts file consists of several lines that begin with a "#" character. Such lines are ignored by the operating system and are just comments.

also in standard file hosts there is an entry "127.0.0.1 localhost". This entry means that when you access the symbolic name localhost, you will be accessing your own computer.

Hosts file fraud

There are two classic ways to benefit from making changes to the hosts file. Firstly, it can be used to block access to sites and servers of anti-virus programs.

For example, after infecting a computer, the virus adds in the hosts file the following entry: "127.0.0.1 kaspersky.com". When you try to open the kaspersky.com website, the operating system will connect to the ip-address 127.0.0.1. Naturally, this is the wrong ip address. This leads toaccess to this site is completely blocked.As a result, the user of the infected computer cannot download the anti-virus or anti-virus database updates.

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

For example, after infecting a computer, the virus adds the following entry to the hosts file: “90.80.70.60 vkontakte.ru”. Where "90.80.70.60" is the IP address of the attacker's server. As a result, when trying to go to a well-known site, the user ends up on a site that looks exactly the same, but is located on someone else's server. As a result of such actions, fraudsters can obtain usernames, passwords and other personal information of the user.

So in case of any suspicion of a virus infection or substitution of sites, the first thing to do is to check the HOSTS file.

Where is the hosts file

Depending on the version of the operating system Windows file hosts can be located in different folders. For example, if you use Windows XP, Windows Vista, Windows 7, or Windows 8, the file is located in the WINDOWS \ system32 \ drivers \ etc \ folder.

In Windows NT and Windows 2000 operating systems, this file is located in the WINNT \ system32 \ drivers \ etc \ folder.

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

Restoring the hosts file

Many hacked users are interested in where you can download the hosts file. However, there is no need to search and download the original hosts file. You can fix it yourself, for this you need to open text editor and delete everything except the line except "127.0.0.1 localhost". This will unblock access to all sites and update your antivirus.

Let's take a closer look at the process of restoring the hosts file:

  1. Open the folder where the file is located. In order not to wander through catalogs for a long time in search of desired folder you can use a little trick. Press the Windows key + R key combination to open the Run menu". In the window that opens, enter the command "% Systemroot% \ system32 \ drivers \ etc" and click OK.
  2. After the folder in which the hosts file is located opens in front of you, do backup the current file. In case something goes wrong. If the hosts file exists, then simply rename it hosts.old. If the hosts file does not exist at all in this folder, then this item can be skipped.
  3. Create a new empty hosts file. To do this, right-click in the etc folder and select the item "Create text document".
  4. When the file is created, it must be renamed to hosts. When renaming, a window will appear in which there will be a warning that the file will be saved without the extension. Close the warning window by clicking OK.
  5. After the new hosts file is created, you can edit it. To do this, open the file with Notepad.
  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".

Windows is far from Linux in terms of the systematic use of configuration files in order to customize the functionality of the operating system. First of all, because Windows uses the registry for this.

Nevertheless, there are such files in Windows, and it is sometimes useful to know about their purpose. An important repository of configuration options is a file called Hosts. The file name has no extension, so when automatic search you do not need to specify it.

In the course of the presentation, we will focus on the OS of the seventh version, as the most widely used by consumers (Microsoft's gimmicks in the G8 have not managed to convince users that Metro is cool).

In essence, we are dealing with a repository of domain names similar to the names of DNS servers. The benefit of using it is that the computer owner is able to adjust the priorities of domains when translating them into real network addresses when accessing Internet resources.

File domains take precedence over any external DNS addresses, even those specified in the settings network connections... The default storage location in the 7 looks like this:% SystemRoot% \ system32 \ drivers \ etc \ hosts. However, this path is not possible. The system administrator can override it by modifying the registry key named HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ services \ Tcpip \ Parameters \ DataBasePath. Files with the same name and purpose are included not only in the Windows system environment, they can be found in Unix-like operating systems, in Mac-OS and even on the Android platform.

Internal structure of Hosts records and storage manipulation

Although Hosts does not have an extension, from the inside it looks like a regular test file with entries in the following format: 127.0.0.1 localhost. That is, with a structure consisting of the domain's IP address and its symbolic name, separated by spaces or tabs.

The given example is a required entry in any such file. It corresponds to the address and name of the user's machine itself. All other entries look like this. With the help of the information placed here, a variety of tasks are solved. For example:

  • You can associate the name localhost not with the address of the local machine, but with the address of any computer on the corporate intranet. This is often done. system administrators enterprises and organizations.
  • Similar associations can be used to optimize access to external hosts. If you create an entry with a range of IP addresses that match real addresses necessary sites, then the loading of their pages will be faster than when accessing the provider's DNS database.
  • Another useful option is the ability to organize blocking of unwanted domains (for example, domains of advertising sites). To do this, all such domains are assigned the address of the local machine - 127.0.0.1

Hosts are basically an outdated technology supported for backward compatibility reasons.

In addition, it has a serious drawback: if the connection to the network uses an intermediate proxy server, then all storage records are simply ignored. There are also security concerns.

The fact is that many viruses like to dig into the contents of a file and change it at will. One of the recommendations given out when viral attack, is to open the file in Notepad and remove from it all entries below the entry of the local machine (localhost).

The Windows 7 operating system has such a file, through which you can regulate visits to sites on the Internet. Basically, people do not know about such a file, and those who do, try to ignore it, so as not to "do miracles". This file is called hosts. Let's see briefly why it is needed.

Let it be known to you that when registering the address of a site in the browser line, a special DNS server located on the Internet immediately changes it into a certain sequence of numbers. This number is unique for each site, and the names of the sites are needed only for ease of memorization. The hosts file is used to speed up work on the World Wide Web, bypassing requests to DNS server... In other words, if you write a digital row corresponding to the name of the site in the hosts file, then you will be taken to it directly, bypassing the DNS server. Only you need to register correctly, otherwise the site will not load, and if it does load, then it is not the one that we would like.

"Computer pests" willingly use the hosts file for their own benefit. A virus penetrating a computer very often changes the hosts file. Therefore, if suddenly you are faced with restricting access to certain sites, first of all, scan your computer, perhaps viruses have settled in it, and only then convert the hosts to its original form.

Where is the hosts file in Windows 7?

So, consider in Windows 7 where hosts is located. You can find it in system folder Windows. It is located on the C drive, that is, where the system is installed. Next, we find the "System 32" folder, go to "Drivers" and, finally, to "Etc". The file we need is saved in this folder.

It also happens that you have not found the hosts file, most likely it is simply hidden and the "Do not show hidden files, folders and drives" option is indicated in the settings. In this case, you need to open the "Computer" folder and press "Alt", at the top of the window will appear extra menu, in it we select "Service" and "Folder Options".
In the new window, select the "View" tab and find the item "Show hidden files, folders and drives", put a tick on it. We accept the changes by clicking the "OK" button. Now go to the "Etc" folder, the hosts file should be displayed.

Now let's look at how you can change the hosts file. Let's proceed as follows:


Where is the hosts file in Windows 10?

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

To change a file in Windows 10, you must:

  • Double click on the hosts file;
  • In the window that appeared we find "Open with";
  • We find among the offered programs "Notepad";
  • Click "Ok";
  • Make changes and save them.
  • If you are a layman in this matter, then it is better not to do anything, but ask for help from a qualified specialist.
  • If something prompts you to make changes yourself, then before that, make a copy of the file and move it to another folder. Suddenly something does not work out for you, then you will return a copy of the file back.
  • If you have not copied this file and have already made changes, and after that the computer started to junk, then the Internet will help you. Download a similar file from the site and replace yours.
  • Before you change something, think about whether it really needs to be done and how important it is for you.

Greetings!

This material will be entirely devoted to hosts file, because of the written lines in which, your Internet browser may display not the popular site you requested, but a fraudulent one (with a similar design, functionality, etc.).

Modifying this file is a favorite pastime for various types of viruses and other malware. At the same time, not every antivirus considers it necessary to protect this file and notify the user about changes made to it.

What is a hosts file and why is it needed in Windows (XP, 7, 8, 10)

By its structure, the hosts file is classic text file, however, it does not have the traditional "txt" extension for this type of file (the hosts file does not have an extension at all).

In order to better understand its role in the system, it is worth talking a little about the principles by which the Internet works, and why this file can affect the opening of the “wrong” site in the browser.

The classic Internet address has an alphabetic format, which you see and personally enter into the address bar of your browser. However, any site has its own IP address, and the computer, opening the site, refers to it precisely by its IP, and not by the letter name. Where does the computer find out the IP address of the site entered into the address bar of the browser? It contacts a remote DNS server for this information. However, if in the hosts file there is a prescribed correspondence of the IP address for a specific site, then the computer and, accordingly, the browser will not even try to send a request to the DNS server, but will immediately address the IP address specified in the file.

Thus, it is possible to replace the site with which it will be displayed, although the "original" address will be displayed in the address bar of the browser.

The task of the "fake" site, as well as other possible scenarios:

  • Stealing data to log into your account, for example, for sending spam.
  • SMS fraud. Under various pretexts, you will be urged to send an SMS, emptying the balance of your mobile phone by a certain amount of money.
  • The site will not be available at all. Providers, upon learning that certain IP addresses are being used for malicious purposes, can revoke them.

Often, using hosts, popular sites are replaced - Vkontakte, Odnoklassniki, etc. Also, with the help of hosts, the opening of sites from which you can download an anti-virus software.

If you see something similar in yourself, then the reason for this may be "harmful" entries in the hosts file. Let's clear the hosts file of extraneous lines and restore the original version.

How to clear \ fix the hosts file

There are several methods, using which, you can clean the hosts file from extraneous and malicious entries. However, it should be noted that by themselves they could not appear there, and therefore, you should first check the system with some popular antivirus solution.

The first method is the AVZ utility

AVZ- antivirus software that allows you to scan and successfully rid the computer being scanned of various types of malicious elements (advertising modules and toolbars, spyware and adware, etc.), as well as restore system settings and parameters that could have been changed during the malware activities.

Official site of the AVZ utility.

To clear and restore the hosts file, you must do the following:


Particularly pleasing is the fact that this utility functions correctly and fully copes with its duties in Windows including XP, 7, 8.1 and latest windows 10.

The second way is with the standard Notepad program

This method of cleaning up the Hosts file is more difficult, because it is essentially "tame". However, it is good because you can personally view the records in this file.


The task of clearing the hosts file is complete.

Brief summary

In the article, I tried to tell in detail what the Hosts file is, what role it plays in the system, what happens if it is used for malicious purposes. Methods and instructions on how to clear Hosts from extraneous entries were covered in detail.

If something remains not completely clear, then comments are always open for questions and clarifications.