Hosts Windows 10 file

Anonim

Hosts file in Windows 10
In this instruction in order will be described how to change the hosts file in Windows 10, where it is (and what to do if it is not there), what is its default contents and how to properly save this file after change, if not persists. Also at the end of the article provides information in case the changes made by Hosts do not work.

In fact, compared with the two previous versions of the OS in the HOSTS file for Windows 10, nothing has changed: neither location, nor content, nor ways to edit. Nevertheless, I decided to write a separate detailed instruction for working with this file in the new OS.

Where is the HOSTS file in Windows 10

The hosts file is in the same folder as before, namely in C: \ Windows \ System32 \ Drivers \ ETC (provided that the system is installed in C: \ Windows, and not elsewhere, in the latter case, look for in the appropriate folder).

At the same time, in order to open the "correct" file Hosts, I recommend to start to enter the control panel (via the right click on the start) - the parameters of the conductor. And on the "View" tab at the end of the list, make a note "Hide extensions for registered file types", and then go to the folder with the HOSTS file.

Meaning Recommendation: Some novice users open the HOSTS file, but, for example, hosts.txt, hosts.bak and the like files, as a result, the changes made in such files do not affect the operation of the Internet, as required. You need to open the file that has no extension (see Screenshot).

Hosts Location in Windows 10

If the hosts file is missing in the folder C: \ Windows \ System32 \ Drivers \ etc - this is normal (albeit strange) and should not be in no way to work the system (by default, this file is so empty and does not contain anything other than the comments that do not affect to work).

Note: Theoretically, the location of the HOSTS file in the system can be changed (for example, some programs to protect this file). To find out if you have changed:

  1. Run the registry editor (Win + R keys, enter Regedit)
  2. Go to RegistryhKey_Local_machine \ System \ CurrentControlset \ Services \ TCPIP \ PARAMETERS \ CURRENTCONTROLSET \ PARAMETERS \
  3. Look at the value of the DatabasePath parameter, this value indicates a folder with the HOSTS file in Windows 10 (default% Systemroot% \ System32 \ Drivers \ etc)
    Location of the Hosts file in the registry

By the location of the file, we finished, go to its change.

How to change Hosts file

By default, changing the HOSTS file in Windows 10 is available only to the system administrators. The fact that this moment is not taken into account by novice users is the most common reason that the Hosts file is not saved after the change.

To change the HOSTS file, you must open it in a text editor, Launched on behalf of the administrator (required) . Show on the example of the standard editor "Notepad".

In the search for Windows 10, start typing "Notepad", and after the program appears in the search results, click on it right-click and select "Run on behalf of the administrator".

Starting notepad on behalf of the administrator

The next step is to open the hosts file. To do this, select "File" - "Open" in a notebook, go to the folder with this file, in the File type field, put "all files" and select the HOSTS file that has no expansion.

Opening Hosts File in Notepad

By default, the contents of the Hosts file in Windows 10 looks like you can see in the screenshot below. But: if HOSTS is empty, it should not be worried about it, this is normal: The fact is that the content of the default file from the point of view of functions is the same as the empty file, since all rows starting with the lattice sign - These are just comments that do not matter to work.

Hosts File Contents in Windows 10

To edit the Hosts file, simply add new lines in a row to look like an IP address, one or more spaces, the site address (URL that will be redirected to the specified IP address).

To be clearer - in the example below, the VK was blocked (all calls to it will be redirected to 127.0.0.1 - this address is used to designate the "current computer"), and is also done so that when entering the address DLink.ru to the address bar of the browser automatically Opened router settings on the IP address 192.168.0.1.

Edited Hosts File in Windows 10

Note: I do not know how important it is, but on some recommendations, the HOSTS file must contain an empty last string.

After editing is completed, simply select File - Save (if hosts is not saved, then you launched a text editor not on behalf of the administrator. In rare cases, it is necessary to separately set the rights to access the file in its properties on the Safety tab).

How to download or Restore Hosts Windows 10

As already written slightly above, the contents of the HOSTS file by default, although it contains some text, but it is equivalent to an empty file. Thus, if you are looking for where to download this file or want to restore it to the default content, then the easiest way will be:
  1. On the desktop, right-click, select "Create" - "Text Document". When you enter the name erase .txt extension, and the file itself call hosts (if the extension is not displayed - turn it on to the "Control Panel" - "Explorer Parameters" below on the View tab). When renaming you will be informed that the file may not open - this is normal.
  2. Copy this file in C: \ Windows \ System32 \ DRIVERS \ ETC

Finish, the file is restored to this species, in which it is immediately after installing Windows 10. Note: If you have a question about why we immediately did not create a file in the desired folder, then yes, it is possible, just in some cases it turns out Not enough rights to create a file there, but with copying everything usually works.

What to do if the hosts file does not work

Changes made in the Hosts file should enter into an action without rebooting the computer and without any changes. However, in some cases this does not happen, and they do not work. If you encounter such a problem, then try the following:

  1. Open the command line on behalf of the administrator (through the Right Click menu by "Start")
  2. Enter the IPConfig / Flushdns command and press ENTER.

Also, if you use hosts to block sites, it is recommended to use two addresses at once - with WWW and without (as in my example from VC previously).

Using a proxy server can also interfere with the hosts file response. Go to the control panel (in the "View" field at the top should be "badges") - the browser properties. Open the "Connections" tab and click the "Network Setup" button. Remove all marks, including "Automatic Definition of Parameters".

Another part that can lead to the fact that the hosts file does not work are spaces before the IP address at the beginning of the line, empty lines between the records, spaces in empty lines, as well as a set of spaces and tabs between the IP address and URL (better use One gap, a tab is allowed). Hosts file encoding - ANSI or UTF-8 is allowed (the default notepad saves ANSI).

ອ່ານ​ຕື່ມ