Hosts file. Original hosts for Windows operating systems Hosts what should be there Windows 8.1

Many ordinary and slightly advanced computer users have been using them for many years and were not aware of the existence of a file named hosts, which does not have a surname (i.e. extension).

But thanks to viruses and imperfections operating systems family of Windows (Windows), users had to get to know this “host”, and quite closely.



What is the hosts file for?

In the Windows operating system (XP, Vista, 7, etc.) the file hosts used to associate (map) host names (nodes, servers, domains) with their IP addresses (name resolution).File hosts is a simple text file that does not have any extension (it doesn’t even have a dot :)).

File hosts physically located in the directory:

  • \Windows\System32\drivers\etc\- for Windows 2000/NT/XP/Vista\7
  • \Windows\- For old Windows 95/98/ME

Most often this directory is located on drive C, so in this case the full path to the file is obtained hosts represents:

By default, only one IP address should be specified in a normal hosts file, this is - 127.0.0.1 . This IP is reserved for localhost, that is, for your local PC. There shouldn't be any other addresses there!

File contents hosts for Windows XP (Russian OS version):



In text form, the contents of the hosts file for Windows XP can be copied from here:

# (C) Microsoft Corp., 1993-1999
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains mappings of IP addresses to hostnames.
# Each element must be on a separate line. The IP address must
# should be in the first column and must be followed by the appropriate name.
# The IP address and hostname must be separated by at least one space.
#
# Additionally, some lines may contain comments
# (such as this line), they must follow the node name and be separated
# from it with the symbol "#".
#
# For example:
#
# 102.54.94.97 rhino.acme.com # origin server
# 38.25.63.10 x.acme.com # client node x

127.0.0.1 localhost

File contents hosts for Windows Vista (English OS version):

In text form, the contents of the hosts file for Windows Vista can be copied from here:

# Copyright (c) 1993-2006 Microsoft Corp.
#

#




#space.
#


#
# For example:
#


127.0.0.1 localhost
::1 localhost



File contents hosts for Windows 7 (English version of OS):

In text form, the contents of the hosts file for Windows 7 can be copied from here:

# 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

Using the hosts file

File hosts theoretically can be used to speed up the Internet and reduce the amount of traffic. This is achieved by reducing requests to the DNS server for resources frequently visited by the user. For example, if you use every day search engines Yandex and Google (sites http://yandex.ru And http://google.ru respectively), then it makes sense in the file hosts after the line " 127.0.0.1 localhost" write the following lines:

93.158.134.11 yandex.ru

209.85.229.104 google.ru

This will allow your Internet browser not to contact the DNS server, but to immediately establish a connection to sites yandex.ru And google.ru. Of course, few people currently do such tricks, if only because of the good modern access speeds.



Restrictions using the hosts file

Some advanced comrades sometimes use the hosts file to block unwanted web resources (for example, erotic content - for children until they grow up and become computer smarter than you). To do this you need after the line 127.0.0.1 localhost also add the bnm line or several lines:

127.0.0.1 address of blocked resource-1

127.0.0.1 addressblocked resource-2

127.0.0.1 addressblocked resource-3

For example:

The essence of this entry is that the specified blocked resource will now be matched by the browser to the IP address 127.0.0.1 , which is the address local computer, – accordingly, the forbidden site simply will not load.

This function is often used by computer viruses, which add browser redirects needed by attackers to the hosts file:

Most often, redirection is done to a “left” site, which visually does not differ from the real resource, while the user’s login and password are stolen (he enters them into the supposedly real fields of the site) or they simply write that your account is blocked (allegedly for spam, etc. ), pay money or send SMS (also very expensive) to unlock. Simultaneously with redirecting to their website from social networking sites, attackers block using a file hosts access to antivirus program sites.

Attention! Never pay for this! And don't send SMS!

A cell phone can only be used as a means of obtaining a password or unlock code. Those. messages should come to you, not come from you.



Although, if you don’t mind the money, check with your first mobile operator cost of sending SMS to this number, to definitely decide that you really don’t mind just giving this amount to someone.

How to edit the hosts file

  1. Each element must be written on its own (separate) line.
  2. The site's IP address must begin in the first position of the line, followed (in the same line) by a space and followed by the corresponding host name.
  3. The IP address and hostname must be separated by at least one space.
  4. The comment line must begin with the # symbol.
  5. If comments are used in domain name matching strings, they must follow the host name and are also separated by # .

Viruses and hosts file

To prevent their actions from being immediately detected, attackers edit the file hosts in a cunning way. Several options are possible:

1. To the end of the file hosts is added VERY there are many lines (several thousand), and the redirection addresses (most often located at the end) are difficult to notice, especially if you view the contents of the file hosts using built-in Windows notepad- a very poor editor.

To view the contents and edit the file hosts It's best to use a text editor that shows the number of lines in a document, such as Notepad++.

You should also be alarmed by the rather large size of the hosts file; in the normal state, it cannot be more than a few kilobytes in size!

2. The original hosts file is edited, after which it is assigned the attribute " Hidden" or " System", because by default hidden files and folders are not displayed in Windows operating systems. In the folder C:\WINDOWS\system32\drivers\etc file is created hosts.txt(by default, extensions are not displayed for registered file types, and the system does not accept the file hosts.txt, she only needs hosts), which is either completely empty, or everything is written as it should be in a real file hosts.

3. Similar to the second option, only here the attackers have already provided the option that extensions for registered file types are displayed in the operating system (the user enabled it independently). Therefore, instead of the file hosts.txt the virus creates a file hosts, which has the letter " O"Russian, not English. Visually the file looks like a real one, but is also not perceived by the system.

In this picture the first file hosts- hidden, the virus made changes to it. Second file hosts- not real, it contains the Russian letter " O" in the name, most often this file hosts empty, viruses do not bother to copy the contents from the real file.

Restoring the hosts file

If you have identified similar changes to your file host, everything needs to be restored to its original state. To do this you need to do the following:

  • Disable real-time protection in your antivirus program, because many normal modern antivirus programs (for example, Avira) do not allow changes to the file hosts.
  • Open directory C:\WINDOWS\system32\drivers\etc
  • Enable the display of extensions for registered file types, hidden files, and system files.
  • Click on the file hosts right click mouse and select the line " Edit with Notepad++":

If you don't have it installed text editor program Notepad++, I recommend installing it first and not using Notepad. If you don't have this moment Internet or just too lazy to download Notepad++, then you can use the poor notepad to edit the file hosts.

To open a file hosts with notepad, you need to left-click on it, it will appear Windows window with the message " Failed to open next file" Set the switch to " Selecting a program from the list manually". Click OK. In the window " Program selection" find in the list Notebook and press OK.

  • Edit the contents of the hosts file so that it becomes as indicated at the beginning of this article.
  • Save changes.
  • Activate antivirus program protection (if disabled).
  • Launch your browser and check that you can view the desired sites.

How the hosts file works

When a user types the address (URL) of a site in the browser and presses Enter, the user's browser:

  • Checks in the hosts file whether the entered name is the computer's own name (localhost).
  • If not, then the browser looks for the requested address (hostname) in the hosts file.
  • If a hostname is found, the browser accesses the IP address specified in the hosts file corresponding to that host.
  • If the hostname is not found in the hosts file, then the browser accesses the DNS resolver cache (DNS cache).
  • If a hostname is found in the cache, the browser looks up the IP address stored in the DNS cache for that host;
  • If the hostname is not found in the DNS resolver cache, the browser contacts the DNS server;
  • If the requested web page (site) exists, the DNS server translates the user-specified URL into an IP address;
  • The web browser downloads the requested resource.

What is the Hosts file for?
The purpose of this system file- assigning certain website addresses a specific IP.
This file is very popular with all kinds of viruses and malware in order to write their data into it or simply replace it.
The result of these actions may be signs of “insertion” of a site into browsers, which will ask to send an SMS when opening the browser, or blocking of various sites, at the discretion of the creators of the virus.

Where is the hosts file in windows?
For different versions Windows OS location of the hosts file is slightly different:

Windows 95/98/ME: WINDOWS\hosts
Windows NT/2000: WINNT\system32\drivers\etc\hosts
Windows XP/2003/Vista/Seven(7)/8: WINDOWS\system32\drivers\etc\hosts


Moreover, the ending hosts, this is already the final file, not a folder. He doesn't have it.

What it should look like correct file hosts?
The "contents" of the hosts file are also slightly different for different versions windows, but not really. It is "written" in English language why it is needed and how to make exceptions with one example. All lines starting with a # sign mean that they are commented out and do not affect the file.
Contents of the original hosts file for Windows XP:


#

#




#space.
#


#
# For example:
#



127.0.0.1 localhost


Contents of the original 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


Contents of the original hosts file for Windows 7:

# 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 handle within DNS itself.
#127.0.0.1 localhost
# ::1 localhost


Contents of the original hosts file for Windows 8:

# 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


As you can see, the contents of the host file for different windows versions, there are no special differences.

How to open and edit the hosts file?
The hosts file can be found in standard Windows Notepad.
This is probably the most interesting part of the article.
First of all, you need to understand why change this file at all? Yes, in order to deny access to certain sites. Thus, by changing this file and having entered the site address into it, the user will not be able to access it through any .
In order to change the hosts file, it is advisable to open it as administrator () by right-clicking on the file and selecting "Run as administrator". Or open Notepad this way and open the file in it.

For quick action, you can simply click the Start button and select Run ( win+r) () and enter in the line:

notepad %windir%\system32\drivers\etc\hosts



As a result, this file will open in Notepad.

In order to block access to the site(let's assume it will be test.ru), you just need to add a line with this site at the very bottom:

127.0.0.1 test.ru


As a result, the file will have the following content:

# Copyright (c) 1993-1999 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

# This HOSTS file created by Dr.Web Anti-rootkit API

#127.0.0.1 localhost
# ::1 localhost
127.0.0.1 test.ru


Each new site that you want to block must be started on a new line and entered, not forgetting the local IP address 127.0.0.1

Also, to edit the hosts file, there is a program HOSTS EDITOR, which you can download and read the description from.
The way it works is that it helps edit the hosts file.
From the screenshot below the principle of its operation is clear; everything is done in a couple of clicks. Adding is done by clicking on +.


After editing, do not forget to click on the save button (2 button "Save changes" to the left of the "+" button).

You can also change this file for good purposes, for example speed up site loading.
How it works?
When you access the site, you see it Domain name, which has letters. But all sites on the Internet have an IP address, and names are already assigned using DNS. I will not go into details of this process, this article is not about that. But here you need to know that the hosts file has priority when accessing sites, and only after it does a request to DNS occur.
In order to speed up the loading of a site, you need to know its IP address and domain.
The IP address of a site can be found using various services, for example or.
A domain is the name of a website.
For example, let's speed up the loading of this site where you are reading an article by explicitly specifying the IP address and domain to the file.
Then the added line will be:

91.218.228.14 website


This speeds up page loading in a couple of seconds, and sometimes can give access if you cannot access the site using standard means.

Still possible redirect to another site using hosts file.
To do this, you need to know the IP address of the site and its domain (as in the case described above), then the added line will be like this:

91.218.228.14 test.ru


And now, after entering test.ru into the address bar of your browser, you will be redirected to the site specified in the IP address..

If you want to clean hosts file, then you can do this by simply deleting the content and inserting the original text from the description above (under spoilers).

Some nuances in the hosts file:

  • Always make sure you have a scroll bar on the side and always scroll to the bottom of the window. This is due to the fact that some viruses are registered in an area hidden outside the window.
  • In some cases, usually if you cannot save the file, you need to log in under the Administrator account.
  • Sometimes, due to viruses, this file may be hidden. Read the article.
  • The two methods described (redirection and acceleration) may not produce the desired result. The fact is that several sites can be located on one IP address, this is especially true for external IP addresses provided by services.
  • Due to the fact that viruses love this file, its attributes can be changed to Hidden And Read-only.
  • Check the file attributes if the hosts file cannot be saved.

    Thus, you can easily and free of charge block access to sites in Windows by editing the hosts file.

  • What's happened hosts file? This question is usually asked by newbie users who know about the existence of such a file only by hearsay. Few people know that this file is used for their own purposes by virus writers, and even fewer are those who use this file on their computer for their own benefit. Meanwhile, it is very important that you have at least some idea about the file hosts and even more important that any user knows how to handle it correctly.

    Problems such as: " I can't log into VKontakte." or " Doesn't fit into classmates?"and similar ones in half the cases (if not more) are associated precisely with changes made in the file hosts. Another question is who makes such changes. In most cases, of course it is viruses, which replace the original hosts file on your computer or add their information to it. All this will be discussed in this article.
    First, I’ll tell you about the file itself. hosts and what it serves for.

    Hosts. What it is?

    In fact hosts is a text file that contains the database domain names compared with their IP addresses. In other words, the address of any domain initially has the form of an IP address. One IP address can host several virtual servers, so there can be several websites on one IP. IN hosts By default, only one is registered in the file ip address (127.0.0.1), which is reserved for localhost, i.e. for your local (namely your) computer.
    Myself hosts file on your computer is located at the following address: (table source: Wikipedia)

    operating system Versions Location
    Unix and Unix-like /etc/hosts
    Windows 95, 98, Me %windir%\
    NT, 2000, XP, 2003, Vista, 7 %SystemRoot%\system32\drivers\etc\ , its location can be overridden in the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\DataBasePath , which contains the folder path.
    Windows Mobile Registry key \HKEY_LOCAL_MACHINE\Comm\Tcpip\Hosts
    Mac OS 9 and earlier System folder: Preferences or just in the system folder
    Mac OS X and iPhone OS /private/etc/hosts or /etc/hosts (/etc on Mac OS X is a symbolic link to /private/etc)
    Novell NetWar SYS:etc\hosts
    OS/2 and eComStation "bootdrive":\mptn\etc\
    Symbian OS 6.1-8.1 C:\system\data\hosts
    9.1+ Z:\private\10000882\hosts
    Android /system/etc/hosts

    Hosts file has no extension, but is easy to edit text editors (for example Notepad)

    Hosts. History of origin.

    When computers were very large, and the Internet was still very small, even then, for the convenience of users, hosts were assigned names. There were few hosts back then. To map text names to IP addresses, it was necessary to send a request to the main host, which sent a list of all names and addresses. This file ( host file) was regularly sent to all computers connected to the Network. As the Global Network developed and expanded, the number of hosts, servers, and users increased, and the host file. There were significant delays in registering and obtaining a name for a new computer connected to the Network. Too much time was spent on mailing host file... To solve these problems, it was created DNS– Domain Name Service. ABOUT hosts file forgot for a while...

    Hosts. Principle of operation.

    Request to hosts file has priority over access to DNS-servers. Unlike DNS, the contents of the file are completely controlled by the computer administrator. What happens when an Internet user types a website address (url) in the address bar of his browser and clicks go ( Enter) ?
    The browser contacts DNS a server that converts this regular address into the IP address of the requested server. At this moment, the browser status bar says: “ Node Search..." If the requested node is found, the text “ Node found, response awaited...", and is installed TCP connection via the standard port for this service. Step by step, more clearly to the question “ What happens when an Internet user types the site address (url) in the address bar of his browser and presses go (Enter)?"You can answer that:

    1. browser accesses hosts file and checks whether the site name matches the computer’s own name ( localhost) i.e. Is the site's IP address equal to the local IP address? 127.0.0.1 ;
    2. if not equal, then checks hosts file for the presence of the requested address (host name);
    3. if the requested address (hostname) is in hosts file, then the browser goes to the host (ip address) specified in this file;
    4. if the requested address is in hosts file not found, the browser accesses the DNS resolver cache ( DNS cache) ;
    5. if the requested address (hostname) is found in DNS Cache e, then accordingly the browser accesses DNS server y;
    6. if such a web page (site) exists, then DNS server translates url V ip address and the browser loads the requested site page.

    So we found out why and How does it work hosts file . Now let's see what it contains.

    Original hosts files. Default contents of hosts files.

    Below I will provide the text that should be contained in hosts file by default, i.e. original hosts file.

    Windows XP

    # Copyright (c) 1993-1999 Microsoft Corp.


    #102.54.94.97 rhino.acme.com

    # source server

    # 38.25.63.10 x.acme.com # x client host

    127.0.0.1 localhost

    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

    # Additionally, comments (such as these) may be inserted on individual

    # lines or following the machine name denoted by a ‘#’ symbol.

    127.0.0.1 localhost

    Windows 7

    # 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

    # Additionally, comments (such as these) may be inserted on individual

    # lines or following the machine name denoted by a ‘#’ symbol.

    # 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 the hosts file for your own purposes.

    Hosts file can be used to reduce the number of requests to DNS server am for frequently visited resources, and this in turn will reduce traffic and speed up the loading of frequently visited resources. For example: you often load the sites google.ru and google.com. Opening hosts file using Notepad and after the line 127.0.0.1 localhost add:
    209.85.229.104 google.ru
    74.125.232.20 google.com

    Before adding, read below the rules for editing the hosts file

    This action allows the browser to immediately, without contacting the DNS server, establish a connection to the sites google.ru and google.com.
    Besides hosts file can be used to block access to unwanted resources on the Internet (adult sites, spam sites, sites with malicious software, etc.). This can be done just as easily by adding immediately after 127.0.0.1 localhost next line
    127.0.0.1 url of the blocked_resource.
    This way the resource address is mapped to the IP address of this computer, and therefore the resource will not load.
    After all changes, when exiting the notepad, save the result.

    Rules for editing the hosts file

    • Each element must be located on a separate line, i.e. when adding a new address, be sure to move to a new line (press Enter);
    • The IP address must start from the first position of the line (let's say so at the beginning of the sentence), must be followed (on the same line) by the corresponding resource address (hostname);
    • The IP address and resource name must be separated by at least one space;
    • Comments must be separated by # (lattice) ;
    • If comments are used in domain name matching strings, they must follow the host name and be separated by # (lattice) ;

    We've sorted out the editing rules. Now let's look at how virus writers and viruses use the hosts file for their own purposes.

    Use of the hosts file by virus writers.

    Those who write viruses have long appreciated the possibilities hosts file and actively use them to their advantage. Viruses replace your hosts file or they edit it in such a way that when you type a certain address (usually the addresses of popular sites), not the site you had in mind opens, but one that looks similar to it, but is actually a site of attackers and distributes malicious codes. In addition to redirecting to their sites, they also block access to the site while extorting money from you in order to re-open access. Attackers mainly use blocking to in social networks.
    On the Internet in many forums you can find thousands of user questions like: “ I can't log into Contact. What to do?" or " Why can't I log in to Odnoklassniki?" or " I can't log into Facebook. Profile is blocked. What to do?". All these problems begin as a result of the fact that you caught a computer disease somewhere. virus and he edited your file hosts. I already wrote about this in the article and will not repeat it, (fortunately, it describes how to fix all this, and therefore I advise you to read this article to the end as well), but I’ll describe the situation when this file hosts I can’t find the address on my computer at all. I will explain clearly with an example windows 7. Let's say you go to a folder and see this picture:


    As you can see from the picture, in this folder hosts file absent ( file lmhosts no need to touch). In fact, it is there, the virus just changed the file attribute to “ Hidden" or " System". I wrote about the “Hidden” and “System” attributes.
    By default, in the folder options there is a checkbox next to the setting “ Do not show hidden files, folders and drives". We need to change this parameter to " Show hidden files, folders and drives". To do this, click Start—> next Control Panel—> next Folders settings View". Here at the very end we rearrange the button with “ Do not show hidden files, folders and drives" on " Show hidden files, folders and drives«.


    Now going to the folder C:\WINDOWS\system32\drivers\etc we see that hosts file on the spot.
    Sometimes hosts file cannot be edited due to viruses on the computer. In such cases, you can simply delete the hosts file and then create it again yourself. To create hosts file, in folder C:\WINDOWS\system32\drivers\etc create a simple text document and call it hosts(I hope everyone knows how to do this). The result will be a text document with the extension .txt(hosts.txt). And as we already know the hosts file has no extension. This means we remove the extension from the name. We do not see the file extension in the name because in the default system configuration the extension for registered files is hidden. Well, let's break it down.
    To do this, click again Start—> next Control Panel—> next Folders settings(in XP “Folder Options”). In the window that opens, go to the second tab “ View". Here (just above the line “Do not show hidden files, folders and drives”) uncheck the " Hide extensions for registered file types". Having done this we will see the file name hosts along with the extension .txt. Now we change the name and remove the unnecessary ones, namely .txt.
    IN windows 7 x64 to find the hosts file you may have to go to the line “ Start - execute» (details about commands) type the command:
    cd\windows\system32\drivers\etc\ and then launch notepad with administrator rights to open hosts.
    Those who cannot or do not want to create a hosts file themselves can download it from our website. Here are the links:
    Original file hosts For
    Original file hosts For
    Original file hosts For

    Afterword:
    Phew... It turned out to be a voluminous article. I think it will be useful to you, both in terms of theory, knowledge base, and in practice.
    That's all. I look forward to your comments.

    Greetings!

    This material will be entirely devoted to hosts a file, due to the written lines in which, your Internet browser may not display 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. However, 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)

    In its structure, the hosts file is a classic text file, but it does not have the traditional “txt” extension for this type of file (the hosts file has no extension at all).

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

    A classic Internet address has a letter format, which you see and enter into the address bar of your browser yourself. However, any site has its own IP address, and when a computer opens the site, it accesses it by its IP, and not by its letter name. Where does the computer find out the IP address of the site entered into the address bar of the browser? It contacts the remote DNS server for this information. However, if the hosts file contains a specified 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 contact the IP address specified in the file.

    Thus, you can replace the site that will be displayed, although the “original” address will be displayed in the browser address bar.

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

    • Stealing your login details account, for example, to send spam.
    • SMS fraud. Under various pretexts, you will be urged to send an SMS, depleting the balance of your mobile phone by a certain amount of money.
    • The site will not be accessible at all. Providers, upon learning that certain IP addresses are used for malicious purposes, can cancel them.

    Often, popular sites such as VKontakte, Odnoklassniki, etc. are replaced using hosts. Also, with the help of hosts, the opening of sites from which you can download antivirus software can be blocked. software.

    If you observe something similar in yourself, then the cause of 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 that you can use to clear the hosts file of extraneous and malicious entries. However, it is worth noting that they could not appear there by themselves, and therefore you should first scan the system with some popular anti-virus solution.

    The first method is the AVZ utility

    AVZ– anti-virus 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 may have been changed during the malicious process activities.

    Official website of the AVZ utility.

    To clean 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 responsibilities in Windows including XP, 7, 8.1 and latest Windows 10.

    The second method is with the standard Notepad program.

    This method of cleaning the Hosts file is more difficult, because... it is essentially “manual”. However, the good thing about it is that you can personally view the records in this file.


    The task of clearing the hosts file is completed.

    Brief summary

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

    If something is not completely clear, the comments are always open to questions and clarifications.

    Hi all!!! I promise to tell you now a very interesting and useful topic about how you can block or unblock access to such social networks such as VKontakte and Odnoklassniki.
    There are cases when the user does not suspect that his computer has been infected with a virus and access to all his favorite sites, such as VKontakte, Odnoklassniki or the sites of anti-virus publishers, has been blocked. In most cases, such a user will see a window on their computer asking them to send just a paid SMS to restore access to their favorite site, but sometimes access to their favorite site is simply blocked without any extortion of money or restoration of access.
    What to do in this case? How to regain access to your favorite site?

    ○ first you need to not panic and under no circumstances send SMS.

    ○ scan your computer for viruses.

    ○ clear cache and cookies in your browser (for Google Chrome: setting up and managing Google Chrome => Tools => Deleting browsing data... ).

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

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

    Let's start changing the hosts file.

    1). Open the hosts file.

    ☻ If your computer has an operating system installed on the “C” drive, then the path to the hosts file will be like this:

    Find in the folder "etc" hosts file, and open this file using 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 click on hotkeys "WIN+ R" .

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

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

    modified hosts file by virus

    I have circled in red a place that you need to pay attention to: if any sites are listed here (for example, VKontakte, Odnoklassniki or any other), then they are blocked for you, and therefore you cannot access 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 it into a clean hosts file.

    I am giving you ready-made standard hosts file samples 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 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

    ☼ 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 what a standard, uninfected hosts file should look like:

    standard hosts file

    Currently no site is blocked. If your file opens exactly like this, it means you have Free access to all your favorite sites.

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

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

    In order to block the necessary sites, the hosts file must be modified by the virus in the following way:

    write down 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 you know how to unblock or block sites by using cleaning hosts file.

    ♦ Attention: It may also happen that changes to the hosts file are still not saved, even if you have cleared the viruses. So the problem needs to be fixed 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 again, i.e. go through all the steps from the beginning to unblock sites or block them.

    If after these operations 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 simply have been hidden from your view.
    If you are running Windows XP, then do the following so that invisible files are displayed:

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

    ○ Go to the tab "View".
    Uncheck the following boxes:

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

    ○ click on the "OK" button.

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

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

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

    Now hidden file hosts is visible for correction.

    You can also try pressing hotkeys "WIN+ R", and in the field "Open" insert this line:

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

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

    Create a hosts file.

    How to create a hosts file?

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

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

    ○ a context menu will open. Select "Create" => "Text document" .

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

    ○ remove the entire name along with the file extension and simply enter hosts . When asked to change the extension, click on the "Yes" button.

    That's all. Your computer no longer blocks VKontakte, Odnoklassniki or other favorite sites. It is worth noting

    Sincerely, WebMasterok2009

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

    Get blog updates!!! Subscribe: