• The hosts file is missing in windows 7. What should the hosts file look like? How to change the hosts file: opening, editing and saving

    Altered Windows hosts files may prevent game client installation, or cause issues with patching. The hosts file is a Windows system file that can override DNS and redirect URLs or IP addresses to different locations. A typical home internet user will not have a modified hosts file.

    Checking for Modifications

    1. Press Windows Key + R.
    2. Type OK.
    3. Open the hosts file with a text editor such as Notepad. Hosts will not have a file extension.
    4. Compare your hosts file with the Microsoft defaults listed below. If yours is different, it has been modified. Remove any lines that contain Blizzard URLs or addresses.
    5. Save the file.

    Note: If your hosts file was modified, run a virus scan . Viruses and malware can modify the hosts file to try to redirect your computer to malicious websites.

    Common Problematic Modifications

    These modifications negatively affect Blizzard games. If you find them, remove them:

    • 127.0.0.1 eu.actual.battle.net
    • 127.0.0.1 us.actual.battle.net
    • 127.0.0.1 enGB.nydus.battle.net

    Resetting the Hosts File to Microsoft Defaults

    To reset the Hosts file back to the default, follow these steps:

    1. Press Windows Key + R.
    2. Type notepad into the Run window.
    3. Click OK.
    4. Copy the following text to the Notepad window: # 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 # localhost name resolution is handle within DNS itself. # 127.0.0.1 localhost # ::1 localhost
    5. On the File menu, select Save as, type "hosts" (including the quotation marks) in the File name box, and then save the file to the desktop.
    6. Press Windows Key + R again.
    7. Type %WinDir%\System32\Drivers\Etc into the Run window and click OK.
    8. Rename the Hosts file to "Hosts.old".
    9. Copy or move the Hosts file that you created from your desktop to the %WinDir%\System32\Drivers\Etc folder. If you are prompted to enter an administrator password, select Continue.

    Using this file, you can establish a correspondence between domain names and their IP addresses. In the general case, this correspondence is determined by the DNS service (server), but if this service needs to be “bypassed,” that is, a non-standard (sometimes useful, and sometimes harmful) mapping is set, then they resort to setting it in the hosts file. This system object appeared with the advent of the Internet, when the DNS service did not yet exist, and was the only way for Windows to match the symbolic name of a site with its physical network address.

    File Format

    This file is a system file and is located in the system partition of the disk in the Windows\System32\drivers\etc\ folder. In format, it is a regular text file named hosts, but without a name extension. It consists of text strings and can be edited with any text editor. Each line can be either a comment (in which case its first character is #) or a matching statement in the format <имя домена>. There must be one or more spaces between the address and name. For example, the string 102.54.81.91 rh.com associates the host rh.com with its address 102.54.81.91. During its installation, Windows 7 generates the standard content of this document, which looks like:

    How to restore hosts

    Sometimes a situation may arise when you need to restore the initial state of this file. It can occur either after its accidental deletion or corruption, or as a result of exposure to malware. It should be said right away that to access this file (including when restoring it) you need administrator rights. Its content can be generated manually in a text editor or downloaded from the Internet.

    Editing a file

    Of course, in order to edit hosts, you need to have administrator rights. You can edit it with any text editor. As an example, we use standard Notepad, which is always installed in Windows 7. You can launch it in two ways - from the command line and by directly calling Notepad:


    After any changes to this document, you must reboot, otherwise its new contents will not be known to Windows 7, since they become known only during a reboot.

    The benefits and harms of hosts changes

    Useful changes to this file include, for example, the following:

    • Setting the IP address and domain to match in order to speed up access to the site by bypassing the DNS server.
    • Changes to block access to a specific site, for example, to block Windows authentication or the availability of updates for a program. To do this, 127.0.0.1 is specified as the IP address, which the operating system perceives as an access to this computer, and not to a real site.
    • Changes to "advertise" this computer as a local server, since the DNS service knows nothing about it. Of course, for this the IP address must be static.

    Hosts are the main target for most malware. There are two main, one might say “classical”, ways of changing this file, which attackers resort to in order to benefit from it. These are the changes:

    • Blocking access to anti-virus program servers so that the computer cannot download such a program or update virus syndrome databases. For example, if, as a result of exposure to a virus or Trojan, a line like “127.0.0.1 esetnod32.ru” appears in the hosts, then any attempts to access the site with this antivirus will be blocked.
    • Substitution of a real website address registered on the DNS server with a fake one. Let’s say that a malicious application that has penetrated a computer writes the line “91.81.71.61 vk.com” in this file, where the address of the computer of the author of this program is specified. This is done with the goal that attempts to access everyone’s favorite site will result in a call to the attacker’s server, the interface of which completely replicates its real counterpart, but is used to collect confidential information about site users, for example, their logins and passwords.

    Therefore, if there is any suspicion of the presence of viruses in the system, you should first check the status of this file, and that is why many anti-virus programs tirelessly monitor its status and notify the user of all attempts to change it.

    This is exactly the question asked by users who are trying to unblock access to Odnoklassniki and VKontakte. In fact, it may turn out that only the visible hosts file is empty, but there is also a hidden hosts file, which blocks access to the most popular sites.

    Let's look at a specific example. You are unsuccessfully trying to log into Odnoklassniki and VKontakte, but you are unable to do so.

    When I try to log into Odnoklassniki, a message appears Incorrect login and/or password.

    When you try to log into VKontakte, a message appears This email address is not registered or the password is incorrect.

    Then you find information on the Internet that you need to check the hosts file.

    The hosts file is located at C:\Windows\System32\drivers\etc. We go to the etc folder in which we find the hosts file.

    We open the hosts file using Notepad and find that the file is empty.

    We open the hosts file and find that it is empty

    What to do if the hosts file is empty?

    Recently, cases have become more frequent when another hosts file appears in the etc folder, but it has the attributes of a system file, i.e. is hidden. In order to see it, you need to enable the option. After enabling the option to display hidden files, it turned out that there are not one, but two hosts files in the ets folder.

    There are foreign entries in the hidden hosts file

    Can the hosts file be empty?

    I will say right away that, in principle, in Winows 7 the hosts file can be empty, since in the standard hosts file all lines begin with the # sign, i.e. are comments. The hidden hosts file can be safely deleted.

    To delete a file, you will need administrator rights.

    After deleting the hidden hosts file, access to Odnoklassniki and VKontakte should be restored.

    Attention! Even if you managed to restore access to sites after deleting the hidden hosts file, be sure to

    Evgeny Mukhutdinov

    Hi all! Yesterday I spent the whole evening on Skype, helping a friend solve the problem of why VKontakte would not open for him. The answer was practically on the surface, but as usually happens in such cases, we stubbornly did not notice it. The trick was that a friend, working on his website in Denver, opened Contact (with Denver running, respectively), and then turned off the computer without turning off Denver. And as a result, in the VKontakte hosts file I entered it with a local IP. Therefore, today, taking a moment, 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 a text file on your device with Internet access (computer, smartphone, etc.). The hosts file contains a database of domain names. Every time you write this or that website address in your browser, a request is initially made to the hosts file, and then only a request is made to the DNS (external servers located on the Internet). And if you block this or that address in the hosts file, then it will no longer be possible to access it from this computer. That's probably all the hosts file does.

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

    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 Filka’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.

    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 to the system folder. Find the hosts file. All! You can congratulate yourself, you are a Computer Genius! 😉

    If you have any problems, or you have a different axis, and you don’t know what or how to do, then write in the comments, I will be happy to answer. And we move on.

    How to open a filehosts? Since we have found the hosts file, now we need to open it somehow. There is nothing complicated about this. Opens hosts with any text editor. I use Notepad++, but you can open it with any other one. Even with regular Notepad, 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 write in English, then, as you can see, the file itself describes in detail what the hosts file does, what should be in it 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 it is unlikely that you will see exactly such a file. Most likely, there will be other lines in your hosts file. For example, if you use Adobe products, 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

    Now let's get to the fun part:

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

    Everything marked with a “#” is a comment. We don't 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 don’t put “#” again, the computer will start taking your line into account. Let's say it again, the line with “#” is a comment and is not taken into account by the computer.

    In the 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 are IP addresses, this is a whole article to write. Therefore, 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 access the Google search engine. Thus, you can deny access to any site by simply 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, mainly Virtual Servers or viruses. But, if virtual servers return hosts to their original state after they are closed, then viruses maliciously edit hosts. In any case, the result is the same: you cannot get to this or that site. Therefore, if you cannot access any site, check the hosts file, perhaps access is denied in it.

    Now I will reveal one terrible secret. Social networks and some other sites are often blocked at work. Often, ISPs block users using the method described above. But, you already know how to change the hosts file 😉

    By the way, if you want to deny your child access to certain sites, then you can easily edit the hosts file, indicating 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

    That's it, after we have edited the hosts file, we can safely save it.

    Few users who work with the "seven" and surf the Internet realize the true meaning of the HOSTS file (Windows 7). Its content will be shown a little later, but for now let’s dwell a little on the theory.

    why is it needed?

    In general, if anyone paid attention, the file itself is located in the etc directory, if you sequentially move along the tree from the Windows folder, through System32 to the drivers directory on the system drive. Not everyone, however, goes into such a thicket of the system; by and large, this is not necessary. On the other hand, if you pay attention, the object itself does not have an extension, although, in fact, it is an ordinary text document.

    But let's take a closer look at Windows 7. Its content is that it is this object that is responsible in the system for the relationship between host names (sites, nodes, etc.) and determining their IP addresses to provide the end user with access to the resource. Roughly speaking, we do not need to enter combinations consisting of numbers in the browser, but we can only specify the names of resources.

    And one more small clarification about the HOSTS file (Windows 7). Its content may change. Depending on what changes have been made, this can help block certain sites, speed up access to certain resources, or, on the contrary, can play a cruel joke by redirecting the user to dubious sites. However, first let's look at the original file.

    (Windows 7): Contents

    So, first, let's try to open It must be said that if you use the standard double-click method, nothing will work, because, as mentioned above, this object does not have an extension. In addition, the file may be hidden, so you should first select show hidden objects in the view menu. But the system will offer several applications to open. We choose the simplest thing - standard Notepad and look at the contents of the HOSTS file (Windows 7). Before us is something incomprehensible: descriptive text, some examples and a line indicating the local IP (# 127.0.0.1 localhost). That's how it should be.

    Attention! There should be nothing below the line indicating the reserved local address, unless, of course, the user wants some resource to be blocked!

    In general, everything above localhost is allowed resources. Everything below is blocked. It is not difficult to guess that many viruses, in particular programs that distribute spam or advertising (Malware, Adware, etc.) independently edit the contents of this file. So it turns out that when requesting one resource, the user receives a redirect (redirection) to a completely different one.

    Default HOSTS in Windows 7

    We reviewed the original file. Now let's look at the changed content. To fix it, you can take the contents of a “clean” file for the “seven” from another computer or from the Internet, copy it, then paste it into the original and save it.

    But there is one problem. The fact is that sometimes, after removing everything unnecessary, it is not possible to save the file as the original (the system simply does not allow this to be done).

    What to do in this case? First, delete the original completely (Shift + Del), bypassing the Trash. Then we right-click on the empty space inside the etc directory and create a new file with the same name, but do not specify the extension. Now we insert the necessary content into it and save the object. After this, you need to find the lmhosts.sam file there and delete it, as indicated earlier.

    That's it, it's done. In both the first and second cases, a system reboot is required. Only then will everything work as expected. And, of course, editing should be done exclusively with administrator rights.

    Bottom line

    Overall, a very brief summary of the HOST file has been provided here. If you look at the issues of blocking some unwanted resources or, on the contrary, allowing access to them with faster access, editing must be done exclusively manually and according to certain rules. Here you need to remember that the key role of the separator is played by the line indicating the reserved local IP. Well, then, as they say, it’s a matter of technique. By the way, the above technique will also help if the contents of the object have been changed due to the influence of virus programs.