Hardware and software setup

Host file is missing. The contents of the hosts file

Greetings!

This article will be entirely devoted to hosts file, due to 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.).

Modification of this file is a favorite pastime for various kinds of viruses and other malware. At the same time, not every antivirus considers it necessary to protect given file and notify the user about the 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 a classic text file, but it does not have the “txt” extension traditional 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 that you see and enter yourself into address bar browser. However, any site has its own IP address, and when a computer opens a site, it refers to it by its IP, and not by its literal name. Where does the computer find out the IP address of the site entered in the address bar of the browser? It refers to the remote DNS server for this information. However, if the hosts file has a prescribed correspondence to the IP address for a particular site, then the computer and, accordingly, the browser will not even try to send a request to the DNS server, but will immediately contact the IP address specified in the file.

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

The task of a "replacement" site, as well as other possible scenarios:

  • Theft of your login information account, for example, to send spam.
  • SMS fraud. Under various pretexts, you will be urged to send an SMS, emptying the balance of your mobile phone for a certain amount of money.
  • The site will not be available at all. Providers, having learned that certain IP addresses are used for malicious purposes, they can cancel them.

Often popular sites are substituted using hosts - Vkontakte, Odnoklassniki, etc. Also, with the help of hosts, the opening of sites from which you can download antivirus software can be blocked.

If you observe 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 hosts file

There are several methods by which you can clean the hosts file from extraneous and malicious entries. However, it is worth noting that they could not appear there on their own, and therefore, you should first check the system with some popular anti-virus solution.

The first way is the AVZ utility

AVZ- anti-virus software that allows you to scan and successfully rid the computer being checked of various kinds of malicious elements (adware modules and toolbars, spyware and adware, etc.), as well as restore system settings and parameters that could be changed during the malware activities.

Official website of the AVZ utility.

To clean and restore the hosts file, do the following:


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

The second way is with the regular program "Notepad"

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


The task of clearing the hosts file is completed.

Summary

In the material, 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 is not fully understood, then the comments are always open for questions and clarifications.

The hosts file is responsible for establishing a correspondence between the domain and the site's IP address. Addressing the host takes precedence over sending a query to the DNS servers, in addition, the file is stored on the computer and controlled by the administrator, which makes it an important element safe work Windows. In some cases, users are faced with the need to restore the hosts file to its original state. You can remove unnecessary entries from it in two ways: manually and automatically, using special software.

Manual recovery

Usually, restoring the hosts file is required after the action of malicious applications that add new entries to it. A typical attack looks like this: you open Odnoklassniki or VKontakte, and the site reports that the account is blocked and asks you to send an SMS to confirm the entry. As a result, money is withdrawn from the phone, and then you will find out that instead of VKontakte, the hosts file redirected you to a fake page.

But the host has nothing to do with it: it just turned out to be a tool in the hands of a malicious software. So after Windows cleaning antivirus needs to start restoring hosts.

Another option is to go to C:\Windows\System32\drivers\et and just open hosts with Notepad. Inside you will see a lot of text on English language. You need to make sure that there are no extra entries in the host. By default, the text should end with "#::1 localhost". Everything after it should be deleted, especially if you yourself did not enter anything into the file.

However, this purge may not be complete, so it is highly recommended that you match your host content to the data listed on the support page at https://support.microsoft.com/en-us/kb/972034 . On Windows 7, the contents of hosts should look like this:

To make sure there are no extra entries, delete the old host and create a new file:


Now the old host will not work, and there will definitely be nothing superfluous inside the new one, so you don’t have to worry about the safety of money and personal data.

Automatic recovery

If manual recovery seems complicated, one can fix the host with special utilities. For example, technical support Microsoft in an article about fixing the hosts file on different Windows versions offers to download the Fix It utility, after launching which extra entries will be deleted without user intervention.

Another way is to use antivirus program AVZ. This powerful tool research and Windows Recovery, but we will consider only one of its functions - cleaning the hosts file.

Hi all! Yesterday I spent the whole evening on Skype, helping a friend solve the problem of why VKontakte does not open for him. The answer lay almost on the surface, but as is usually the case in such cases, we stubbornly ignored it. The whole trick was that a friend, working on his site in Denver, opened Contact (with Denver running, respectively), after which he turned off the computer without turning off Denver. And as a result, in the hosts file, VKontakte signed up with a local ip. Therefore, today, having seized a minute, I decided to write another post, devoting it to the hosts file. In this article, we will talk about what the hosts file does, what it is for, how to find it, how to edit and save it. Also, at the very bottom of the article, you can download the hosts file. I will try to describe everything in simple human language, so that even an amateur who is not particularly versed in computers can understand.

What's happenedhosts? The hosts file is text file on your device with Internet access (computer, smartphone, etc.). The hosts file contains a database of domain names. Every time you write a particular site address in your browser, the hosts file is initially requested, and then only the DNS (external servers located on the Internet) is accessed. And if you forbid this or that address in the hosts file, then it will be impossible to access it from this computer. That, perhaps, is all that the hosts file does.

How to find a filehosts? The hosts file is located in different places on different operating systems. Below is a table of how it can be found in the most popular operating systems

Everything below, until the next paragraph, is dedicated to those who do not know what to do with this table. And so, if for you this is Filkin's letter, written in Chinese, then most likely you have Windows. Here, based on this OS, I will explain how to find the hosts file.

We go to My computer. Click on the address bar (see screenshot) and paste this phrase there: C:\Windows\system32\drivers\etc . This is the path to the hosts file. Then press Enter.

We get into the system folder. Find the hosts file. Everything! You can congratulate yourself, you are a computer genius! 😉

If you have any problems, or you have a different axis, and you do not know what and how to do, then write in the comments, I will be happy to answer. And we're moving on.

How to open a filehosts? Since we have found the hosts file, now we need to somehow open it. There is nothing complicated in this. Opens hosts by anyone text editor. I use Notepad++ but you can open it with any other. Even the usual Notepad, which is built into Windows by default.

What should be in the hosts file? Nothing extra. But seriously, a clean hosts file should look like this:

# 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 # ::1 localhost

If you are squirting in English, then, as you can see, the file itself says in detail what the hosts file does, what it should contain and how to change it. I also want to remind you that at the end of the article you can download the hosts file, so there is no need to copy it from here.

But, the fact that you will see just such a file is unlikely. Most likely, there will be other lines in your hosts file. For example, if you are using by Adobe, then at the end you will find something like:

127.0.0.1 adobe-dns.adobe.com 127.0.0.1 adobe-dns-2.adobe.com 127.0.0.1 adobe-dns-3.adobe.com

And now, let's move on to the most interesting:

Editinghosts. And so, now we will learn how to change the hosts file. First, let's understand what certain symbols mean in it. It is very easy, at the level of the first grade (my student goes to the second grade, edits this file once or twice).

Anything marked with a "#" is a comment. We do not take them into account. Those. you can put "#" and write whatever you want. This will not be taken into account by the computer. But, as soon as you move to a new line, if you do not put "#" again, the computer will begin to take into account your line. Let's go again, the line with the "#" is a comment, and is not taken into account by the computer.

Desert lines in hosts are ignored. You need to put them only for your convenience, so as not to get confused later.

The numbers 127.0.0.1 are the local ip address. What is ipadres, it is necessary to write a whole article. Therefore, for now, the main thing for us to remember is that any Internet address after 127.0.0.1 will be ignored, and you will not be able to access it on the Internet.

For example, having a line like:

127.0.0.1 google.ru

You will not be able to enter Google search engine. Thus, it is possible to deny access to any site, just by entering the url of the unwanted site after the local ip address.

These lines must be entered at the end of the file. Each new site address must start on a new line.

Sometimes it happens that some programs change this file, mostly Virtual Servers or viruses. But if virtual servers after closing them return hosts to the initial state, then viruses maliciously edit hosts. In any case, the result is the same: you cannot get to a particular site. Therefore, if you cannot access a site, check the hosts file, it may be that access is denied in it.

Now I will reveal one terrible secret. Often blocked at work social media and some other sites. Often, AI silencers block in exactly the way described above. But, you already know how to change the hosts file 😉

By the way, if you want to prevent your child from accessing certain sites, then you can easily edit the hosts file by specifying the addresses of unwanted resources in it. As a result, your hosts file will look like this:

# 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 # ::1 localhost 127.0.0.1 Enter the address of the site you want to block 127.0.0.1 Enter the address of the site you want to block 127.0.0.1 Enter the address of the site you want to block

Everything, after we have edited the hosts file, we can safely save it.

If you are editing an existing file, you save hosts as a normal document. For example, by pressing Ctrl+S or File -> Save.

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 "perform miracles." This file is called hosts. Let's briefly understand why it is needed.

Let it be known to you that by writing 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 digital series is unique for each site, and site names are needed only for ease of remembering. The hosts file is used for speed world wide web Internet, bypassing queries to the DNS server. In other words, if you write a number in the hosts file corresponding to the name of the site, then you will get to it directly, bypassing the DNS server. You only need to register correctly, otherwise the site will not load, if it does load, then it is not the one that you would like.

"Computer pests" willingly use the hosts file for personal gain. 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, viruses may have settled in it, and only then convert the hosts to their 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 drive C, 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 stored in this folder.

It also happens that you did not find the hosts file, most likely it is simply hidden and the “Do not show” parameter is indicated in the settings. hidden files, folders and drives. In this case, you need to open the "Computer" folder and press "Alt", an additional menu will appear at the top of the window, select "Tools" and "Folder Options" in it.
In the new window, select the "View" tab and find the item "Show hidden files, folders and drives", put a tick on it. 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?

hosts file in operating system Windows 10 is located in the same place as Windows 7, that is, on system drive. In the “Windows” folder, then follow 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 proposed 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 doing so, make a copy of the file and move it to another folder. If something doesn’t 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 the computer then started to act up, then the Internet will help you. Download a similar file from the site and replace yours.
  • Before you change something, think about whether you really need to do it and how important it is for you.

Using the hosts file on your computer, you can set up a mapping between a domain and a specific IP address.

Such a setting may be necessary, for example, if you have transferred the site and domain to a new hosting, and you need to check the operation of the site at its main address. However, the cache of the DNS server still "remembers" the previous A-record of the domain, and when accessing the site, it will return the previous IP address, where the site is no longer available. In order not to wait for the DNS cache to be updated (it can take several hours), you can specify the necessary combination of domain and IP address in the hosts file - a request to this file takes precedence over requests to DNS servers.

Find out which IP the request is going to this moment when accessing a domain, you can use ping commands- work with it is described in more detail.

Another option for using the setting in hosts is to prevent access to a particular site from your computer. For example, if the facebook.com domain is assigned an incorrect IP in hosts (say, 127.0.0.1), then it will be impossible to go to this site from your computer.

The setup itself is very simple: just specify the desired IP address in the file, and after a space from it - Domain name. Changes must be made as an administrator.

Windows

If the system was installed by default on drive C, the file will be located along the path: c:\windows\system32\drivers\etc\hosts .

Open desired file can be done in one of the following ways. Make sure that all actions you perform on behalf of the administrator.

Option 1.

Run command line(press Win + R, type cmd in the window that appears and click OK) and execute the command below in it:

Notepad.exe c:\windows\system32\drivers\etc\hosts

The hosts file will be opened in notepad and you can enter .

Option 2.

Go to "My Computer" -> local disk C -> Windows -> System32 -> drivers -> etc or paste the desired path into the address bar of the explorer:

In the etc folder, click right click click on the hosts file, select "Open With" and then select "Notepad":


Typically, the file looks like this:


Enter the required IP and domain, for example, 92.53.96.120 mydomain.com:


Save your changes. To do this, select "File" - "Save". In the window that opens, select "All Files" and click "Save".


To check the settings, .

Liked the article? Share with friends!
Was this article helpful?
Yes
Not
Thanks for your feedback!
Something went wrong and your vote was not counted.
Thanks. Your message has been sent
Did you find an error in the text?
Select it, click Ctrl+Enter and we'll fix it!