One Reply to “What does the hosts file do and how to find it?”. How to change the hosts file

Many ordinary and slightly advanced computer users have used them for many years and were unaware of the existence of a file named hoststhat does not have a last name (i.e. extension).

But thanks to viruses and the imperfect operating systems of the Viper family (Windows), users had to get acquainted with this "host", and, quite closely.



What is the hosts file for?

In the Windows operating system (XP, Vista, 7, etc.) file hosts  used to associate (match) host names (nodes, servers, domains) with their IP addresses (name resolution). File hosts  - This is a simple text file that has no extension (it does not even have a point :)).

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 the C drive, so in this case the full path to the file is obtained. hosts  represents sosboy:


By default, only one IP address should be specified in the normal hosts file; this is 127.0.0.1 . This IP address is reserved for localhost, that is, for your local PC. No other addresses should be there!

File contents hosts  for Windows XP (Russian OS):




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

# (C) Microsoft Corporation (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 host names.
# Each element should be located on a separate line. IP address must
# be in the first column, followed by the appropriate name.
# The IP address and host name must be separated by at least one space.
#
# In addition, comments may be inserted in some lines.
# (such as this string), they must follow the node name and be separated
# from it with a "#".
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # client node x

127.0.0.1 localhost

File contents hosts  for Windows Vista (English OS):


In plain text, 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 OS):


In plain text, 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 IP addresses to host names. Each
# entry line The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address should be 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, it can be used to speed up work on the Internet and reduce traffic. This is implemented by reducing the requests to the DNS server for resources frequented by the user. For example, if you use Yandex and Google search engines every day (sites http://yandex.ru  and http://google.com  respectively), 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

Google.com

This will allow your Internet browser not to access the DNS server, but to immediately connect to the sites. yandex.ru  and google.ru. Of course, such tricks are currently made by few, if only because of the good modern access speeds.



Restrictions using hosts file

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

127.0.0.1 address of the blocked resource-1

127.0.0.1 addresslockable resource-2

127.0.0.1 addressblocked resource-3

for example:


The essence of this record is that the indicated blocked resource will now be matched by the browser with the IP address. 127.0.0.1 , which is the address of the local computer, - accordingly the forbidden site simply will not load.

Often this function is used by computer viruses, which add to the hosts file the redirections for browsers that hackers need:


Most often, the redirection is done on the "left" site, visually not different from this resource, while the user is stolen login and password (he enters them into the supposedly real fields of the site) or simply write that your account is blocked (supposedly for spam and other ), pay money or send SMS (also very paid) to unlock. Simultaneously with redirection to your site from social networking sites, attackers block using a file hosts  access to antivirus software sites.


Attention! Never pay for it! And do not send SMS!

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



Although, if you don’t feel sorry for the money, first check with your mobile operator the cost of sending an SMS to this number, in order to decide exactly what you really don’t feel sorry to just give someone this amount.

How to edit the hosts file

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

Viruses and hosts file

Attackers, so that their actions are not immediately detected, edit the file hosts  in a sly way. Several options are possible:

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

To view the contents and edit the file hosts  it is best to use a text editor that shows the number of lines in a document, for example, Notepad ++.

Also, you should tune up the rather large size of the hosts file, well, in no way in the normal state can it be more than a few kilobytes in size!

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

3. Similarly, as in the second version, only here the attackers have already foreseen the option that extensions for the registered file types are displayed in the operating system (the user has turned on himself). Therefore, instead of the file hosts.txt  the virus creates a file hostswhich has the letter " about"Russian, not English. Visually, the file looks like a real one, but it is also not perceived by the system.


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

File recovery hosts

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

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


If you do not have the Notepad ++ text editor installed, I recommend installing it first and not using Notepad. If you do not have the Internet at the moment or just too lazy to download Notepad ++, then you can use a poor notebook to edit the file hosts.

To open a file hosts  Notepad you need to click on it with the left mouse button, a Windows window will appear with the message " Could not open next file ...". Set the switch to " Manual selection of a program". Click Ok. In the window " Program selection"find in the list Notebook  and press Ok.


  • Edit the contents of the hosts file to become as indicated at the beginning of this article.
  • Save changes.
  • Activate antivirus protection (if disabled).
  • Launch a browser and check the ability to view the desired sites.

How hosts file works

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

  • Checks in the hosts file whether the entered name is not a proper computer name (localhost).
  • If not, the browser searches for the requested address (host name) in the hosts file.
  • If a host name is found, the browser accesses the corresponding IP address for this host specified in the hosts file.
  • If the host name is not found in the hosts file, then the browser accesses the DNS resolver cache (DNS cache).
  • If the host name is found in the cache, the browser accesses the corresponding IP address stored in the DNS cache;
  • If the host name is not found in the DNS resolver cache, the browser accesses the DNS server;
  • If the requested web page (site) exists, then the DNS server translates the user-defined URL into an IP address;
  • The web browser loads the requested resource.

The Windows operating system (OS) (like other OS) has the ability to speed up the transition to the IP address of the site you typed without accessing the DNS (DomainNameSystem). To do this, use a special file of the operating system called hosts (used without any extension). The question arises: "File hosts - what should it be there?"

What is needed and what the hosts file contains

If this file contains the correspondence of the site name to its actual IP address, then the redirection occurs without contacting your provider’s DNS service. - This is a plain text file that can be opened with any such Notepad (but requires administrative rights). By default, the file contains several lines of explanations (comments) in English or Russian and the only executable line that provides redirection to the IP address of the computer itself calls to the localhost name.

Where the hosts file is located

Usually the hosts file can be found:

  • in Windows OS 95/98 / ME versions - in the WINDOWS directory;
  • on Windows versions of NT / 2000, at the address WINNT \\ system32 \\ drivers \\ etc;
  • the Windows 7 hosts file (and Windows XP / 2003 / Vista / 8 versions) is located in the WINDOWS \\ system32 \\ drivers \\ etc directory.

Other operating systems also have a file hosts with similar functions. Where the hosts file in these OS is located must be considered separately.

Why the file is important for protection against viruses

The importance of addressing the issue of hosts, which should be there, is that some of the specific properties of this file are used to protect against antivirus programs and to block the calling of certain files. After all, if the hosts file is written to redirect antivirus programs to a false IP address, then the computer will not be able to carry out the work of these programs, and, for example, the anti-virus databases will simply not be updated.

Therefore, if your computer has problems with the operation of antivirus programs, one of the reasons may be an unauthorized change of the hosts file of your computer.


What can the hosts file be used for?

Some users use it to prevent certain sites from being used, for example, pornographic or websites of annoying social networks. To accomplish this task, you can simply type in the end of the file for each site one line of the type: 127.0.0.1 “site name”. At the same time, the sites on whose behalf users on this computer are trying to navigate will simply not be invoked.
  You can do this trick: redirect those trying to call the undesirable, for example, Mashkov libraries, by entering the line: 81.176.66.163 "site name".


Exclude advertising

Also the question of hosts, which should be there, is important because by making some additions to it, you can avoid displaying annoying contextual and / or banner ads, which in some sites are added not only around the information content of the pages, but also interspersed with text. articles. To do this, you need to redirect the sites that host these types of advertising to 127.0.0.1, as indicated above. And these are sites such as, for example, "Google" contextual advertising AdSense. To exclude its display, the following lines should be entered in the hosts file:

  • 127.0.0.1 pagead.googlesyndication.com;
  • 127.0.0.1 pagead2.googlesyndication.com.


On the Internet, you can find ready-made texts for insertion into the hosts file, containing many such lines, which exclude the display of unnecessary. In addition, there are ready-made texts for setting up faster work with some search engines, for example, hosts google. However, such materials should be used carefully. It is undesirable for the size of the hosts file to exceed 10 KB. Otherwise, he himself will slow down the system. Although these 10 KB can accommodate many similar lines of redirection.

Possible difficulties

First you need to make sure that you want to edit the file. The fact is that some tricky creators of virus programs disguise the hosts file used by the system, placing it in the wrong place where it is registered by default. The system accesses the Windows 7 hosts file, the path of which is registered in the registry in the DataBasePath parameter located at: HKEY_LOCAL_MACHINE \\ SYSTEM \\ CurrentControlSet \\ services \\ Tcpip \\ Parameters \\.

The correct path value looks like:% SystemRoot% \\ system32 \\ drivers \\ etc \\ hosts. You can check this by calling the registry editor regedit.exe from the Start menu - execute.

If the specified variable contains a different value, you need to restore the value that should be.

Another trick of malware is to place in the etc directory along with the hosts file another file with a similar name, for example host. Be careful, make sure that you check and edit exactly the file that is used by the system.

The third trick is to hide the file for viewing. Just prescribe in the file properties that it is hidden. In this case, it is simply not visible in the catalog, although it is present there. To be able to view, you must first install the item "Show hidden files." In Windows XP, this option is set in the "View" tab of the "Properties" panel of the "Control Panel" menu folder. After that, viewing of hidden files will be possible, and it will be possible to reset the “hidden” feature in the properties of this file. At the same time, check if the read-only flag is set for this file. If installed, you can not edit it. It is necessary to uncheck the corresponding box in the file properties panel.


The next trick may be to use a proxy. If the manual setting of the proxy is set, then the hosts file does not work. To eliminate this drawback, check your browser settings. For example, for Firefox, open "Settings", then "Advanced", then select the "Configure" item in the "Network" tab. In the menu that appears, if the option “Use system proxy settings” has been selected, select “No proxy” and save the settings. But if the item “Manual proxy service settings” was selected, and you didn’t install it, then you need to do more work. First you need to remember the set address of the proxy server, set the item “No proxy”, save the settings. Then you need to open the registry editor, call the search, insert the memorized address and perform the search, deleting the assigned value of your address in the found keys.

Simple protection

By the way, in order to prevent malicious programs from changing the settings of the hosts file of your computer, it is useful to set the “Read Only” attribute in its properties (after all your changes in it).

Thus, in this article we dealt with the question of Hosts, what should be there, and found out what file it is, where it is located, what functions it performs, how it can harm a computer under the influence of malware, and how to use it in its purposes.

The hosts file is quite a weak point in the Windows operating system. This file is 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 is infected with viruses.

What is the hosts file?

The task of this file is to keep a list of domains and their corresponding ip-addresses. The operating system uses this list to convert 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 a domain to an ip address. Now this conversion is 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 to 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 malware use.

As for the file structure, the hosts file is a plain text file in the expansion box. That is, this file is not called hosts.txt, but simply hosts. To edit it, you can use a plain text editor Notepad.


The standard hosts file consists of several lines that begin with the “#” character. Such lines are not taken into account by the operating system and are just comments.

Also in the standard hosts file 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.

Frauds with the hosts file

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, infecting a computer, the virus adds   There is an entry in the hosts file: “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 to access to this site is completely blocked.  As a result, the user of the infected computer cannot download antivirus or updates of antivirus databases.

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

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 access a well-known site, the user enters a site that looks exactly the same, but is located on a foreign server. As a result of such actions, fraudsters can get logins, passwords and other personal information of the user.

So in case of any suspicion of a virus infection or the 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 Windows operating system, the hosts file may 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.


On 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 in Windows 95, Windows 98 and Windows ME, this file can be found simply in the WINDOWS folder.

File recovery hosts

Many hacked users are interested in where to download the hosts file. However, searching and downloading the original hosts file is not necessary at all. You can fix it yourself; to do this, you need to open it with a text editor and delete everything except the line except “127.0.0.1 localhost”. This will allow you to unblock access to all sites and update the antivirus.

Let us consider in more detail the process of restoring the hosts file:

  1. Open the folder where this file is located. In order not to wander through the directories for a long time in search of the desired folder, you can use a little trick. Press the key combination Windows + R to open the Run menu". In the window that opens, enter the command "% Systemroot% \\ system32 \\ drivers \\ etc"  and click OK.
  2. After you open the folder in which the hosts file is located, make a backup copy of the current file. In case something goes wrong. If the hosts file exists, just rename it to hosts.old. If the hosts file is not in this folder at all, then this item can be skipped.
  3. Create a new empty hosts file. To do this, right-click in the etc folder and select "Create a 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 an extension. Close the warning window by pressing the OK button.
  5. After the new hosts file is created, it can be edited. To do this, open the file using Notepad.
  6. Depending on the version of the operating system, the contents of the standard hosts file may vary.
  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".

Hello to all! Yesterday I spent the whole evening on Skype, helping my friend solve a problem why VKontakte doesn't open for him. The answer lay almost on the surface, but as is usually the case in such cases, we stubbornly did not notice it. The whole trick was that a friend, working on his website in Denver, opened a Contact (while Denver was running, respectively), then turned off the computer without turning off Denver. And as a result, in the hosts file VKontakte enrolled with a local ip. So today, taking 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 with a simple human language, so that even an amateur who doesn’t know much about computers can understand.

Whathosts?The hosts file is a text file on your device that has access to the Internet (computer, smartphone, etc.). The hosts file contains the domain name database. Every time when you write one or another website address in your browser, the hosts file is initially requested, and then a DNS call is received (external servers located on the Internet). And if you deny a particular address in the hosts file, then it will be impossible to access it from this computer. Here, perhaps, everything that makes the file hosts.

How to find a filehosts?File hosts in different operating systems is in different places. Below is a table, as it can be found in the most popular OS

Everything below, to the next paragraph, is dedicated to those who do not know what to do with this table. And so, if for you this is a Filkina diploma 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 in 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 fall into the system folder. Find the hosts file. Everything! You can congratulate yourself, you - Computer genius! 😉


If you have problems, or you have a different axis, and you do not know what to do, then write in the comments, I will be happy to answer. And we go further.

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

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 IP addresses to host names. Each line entry. The IP address followed by the corresponding host name. # The IP address should be spaced 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 DNS DNS itself. # 127.0.0.1 localhost # :: 1 localhost

If you speak 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 see just such a file is unlikely. 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, go to the most interesting:

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

All that is marked with a “#” is comments. We do not take them into account. Those. You can put a “#” and write whatever you want. It 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, once again, the line where the “#” stands is a comment, and is not taken into account by the computer.

Desert strings in the hosts are ignored. You need to install them only for your convenience, so that you do not get confused later.

The numbers 127.0.0.1 is the local ip address. What is ipadresa, it is necessary to write an entire article. 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.com

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

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

Sometimes it happens that some programs change this file, basically it is Virtual servers or viruses. But, if the virtual servers after their closure return the hosts to their original state, then viruses maliciously edit the hosts. In any case, the result is one: you can not get on a particular site. Therefore, if you cannot access any site, check the hosts file, it is possible that access is denied in it.

Now I will reveal one terrible secret. Often at work they block social networks and some other sites. Often, ai tishniki put the lock exactly in the manner described above. But, you already know how to change the file hosts

By the way, if you want to deny your child access to certain sites, then you can easily edit the hosts file, specifying the addresses of unwanted resources. 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 IP addresses to host names. Each line entry. The IP address followed by the corresponding host name. # The IP address should be spaced 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 DNS DNS itself. # 127.0.0.1 localhost # :: 1 localhost 127.0.0.1 Enter the address of the site that you want to deny 127.0.0.1 Enter the address of the site that you want to deny 127.0.0.1 Enter the address of the site that you want to deny

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

If you are editing an existing file, then save the hosts as a regular document. For example, a combination of buttons Ctrl + S or File -\u003e Save.

If you have created a new hosts file, then save it with the Ctrl + Alt + S key combination or File -\u003e Save As ... In the field that opens, write the name of the hosts file, save as a plain text document.

Well, that's probably all. Now it remains only to put a direct link on which you can download the hosts file, and wish everyone a good day.

  hosts file

P.s.

I want to remind you that if anyone has any questions, then you are welcome in the comments. I will also be grateful if you click on one of the buttons of social networks under the article.

hosts  - a text file containing a database of domain names and IP addresses to match them (you can say the local DNS). This file is actively used by viruses to block access to certain sites or redirect to infected sites on sites.

To begin, I propose to consider in more detail the process of opening the site in terms of routing.

After entering the required site in the browser, suppose Google.com ,   The browser consistently (according to priority) looks for a mapping of this domain name to an IP address (because network devices work with IP addresses).

  but) the specified site is checked in the hosts file, if it finds a match (suppose 1.1.1.1 Google.com is registered in the hosts file), then the contents of IP will open to you - 1.1.1.1, if there is no specified domain name, proceed to the next step;

b)  cache dns is checked (if you previously opened Google.com, then most likely the IP of this site is stored in the DNS cache of your computer / laptop), if the IP of the site is listed there, the page opens to you if it does not proceed to the last stage;

at)  request to the DNS server (it is entered manually in the network connection settings or issued via DHCP), if there is no specified site in the DNS server, it will “ask” another DNS server until it finds it (if of course it exists at all) and the site is successful will open.

The hosts file is located at the path C: \\ Windows \\ System32 \\ Drivers \\ etc \\ hosts (if the system disk is C). You can open it with a regular notebook. If you did not make changes to the hosts file, the following will be written there:

File hosts in Windows XP:
# Copyright (c) 1993-1999 Microsoft Corp.
#
#


# space.
#

#
# For example:
#

127.0.0.1 localhost

Hosts file inWindows Vista:
#
# This is a sample HOSTS file used by Microsoft TCP / IP for Windows.
#
# This file contains the IP addresses to host names. Each
# entry line The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address should be 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

Hosts file inWindows 7:
# Copyright (c) 1993-2006 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP / IP for Windows.
#
# This file contains the IP addresses to host names. Each
# entry line The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address should be 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

Hosts file in  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 IP addresses to host names. Each
# entry line The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address should be 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, regardless of the version, the host file is not very different, but if a different site and IP-Schniki can be added to the hosts file, it worked. For example:

127.0.0.1 ftp.kasperskylab.ru
  127.0.0.1 ids.kaspersky-labs.com
  127.0.0.1 vk.com
  127.0.0.1 drweb.com

Such additions in the file do not allow you to go to these sites.

1.2.3.4 ftp.kasperskylab.ru
  1.2.3.4 ids.kaspersky-labs.com
  1.2.3.4 vk.com
  1.2.3.4 drweb.com

Such additions in the file when opening the indicated sites redirect you to other sites, possibly infected with viruses (IP-1.2.3.4- are fictional).

If you find out that the hosts file has been changed, you need to fix it. In Windows XP, the file is simply opened with Notepad, the necessary changes are made and saved (you must log in as administrator). On other versions (Windows Vista, 7, 8) it is necessary to give permission to change the file. To do this, open the folder in which the hosts C: \\ Windows \\ System32 \\ Drivers \\ etc(if drive C is system). Right click on hosts  and choose "Properties".

Choose a tab "Security", then select the user under which you work on the computer / laptop (in this example, this is the site) and click the button "Change". A window will open "Permissions for the hosts group", again select the user and assign full rights to the file, click "OK",in the window   "Properties: hosts",also   "OK".


After that, open the hosts Notepad and return the file to its original state, at the end save the changes.

Like this article? Share with friends: