Windows 10 Hosts File Location, Edit | 911-win.com

Date of publication of the material 23.10.2019 Article views 361 Number of likes to article 0 Number of Comments

As we all already know in the system partition of the disk, which is used to preserve the operability of the operating system, there are many folders and files, which provide regular operation of Windows and all components.

Given their importance for the correct operation of the computer as a whole, their contents and any changes should be treated with extreme caution, as rash actions can lead to rather sad consequences.

One of such important components of the operating system is the “Hosts” file, known to many when working with Windows 7.

Has something changed in the "hosts" in the new version of Windows 10? What is this file for? How can I find and change it? And also how to avoid possible problems?

You can find answers to these and other questions in the framework of this article.

Windows 10 Hosts Location

The “hosts” file is a component of the operating system, and, if we speak in the most simplified form, its purpose is to disable and enable access to certain resources within the local network and the Internet.

If necessary, you can make changes to this file and designate resources (their IP addresses) access to which will be blocked. You can call it a kind of parental control, necessary to filter out certain sites, for example, a social network or any other.

Quite often, employers of small offices use this lock to restrict users' access to certain resources.

As in previous versions of the operating system, the file in question in Windows 10 is located in the folder “C:\Windows\ System32\ drivers\ etc”, where “C” is the letter of the system partition of the disk.

Windows 10 Hosts File Location

In order to open it and view the contents you will need any editor, for example, a standard (preinstalled) "Notepad" or a more functional "Notepad++", which can be downloaded from the official website of the developers - https://notepad-plus-plus.org/.

Special attention should be paid to the value of this file, set by default, as any other changes are guaranteed to have certain consequences.

The content of "hosts" is as follows: 

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:


#     rhino.acme.com          # source server

#     x.acme.com              # x client host

# localhost name resolution is handle within DNS itself.

#       localhost

#       ::1             localhost

Hosts file content by default

The above content can be used if you need to return the value of the "hosts" file to the standard view, avoiding possible authorized / unauthorized blocking of network resources.

It is also worth noting that some users may find that the "etc" folder is missing the file in question.

This is not quite a regular situation, but it is easy enough to fix this situation, for this you should:

  • Run the registry editor by running (WIN+R) command "regedit"; 

Open Regostry Editor with ergedit command

  • Open "HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Services\ Tcpip\ Parameters\" and find the "DataBasePath" parameter»;
  • Pay attention to the value of this parameter, the path specified there will indicate the location of the "hosts" file within your operating system. 

Go to Path to Parametrs - in that indicate location to file Hosts

It should be understood that the location of the file can be changed by any process to ensure the security of Windows, which will not seriously affect the operation of the operating system.

How to Change Hosts File

Once the "hosts" is detected you can proceed to edit it, but given the above features of its purpose.

Do not make comments in it, the purpose of which you do not know.

For the rest, you can rely on the following mini-instructions for editing:

  • Open a text editor with administrator privileges, as only such permissions allow you to make the desired changes. As an example, you can use the previously mentioned "Notepad"; 

Need run Notepad as administrator

  • Next, open the location of the file "hosts", selecting the display in the editor "All files"; 

Next, open the location of the file (hosts), selecting the display in the editor - All files

  • Do not be afraid if after opening you find that the file is empty. All the content above is just comments that do not affect the operation of Windows. The "#" sign for the system has the same value as the empty string.
  • To make changes, simply specify the necessary addresses after the comments, for example, to block access to the social network "Facebook" it is enough to make the following lines



You will only have to save the changes and the restrictions will take effect without rebooting. 

For the changes to take effect, you need to restart the PCIt will not be superfluous to note that it is necessary to adhere to some recommendations for editing the file "hosts":

  • If you need to put a space, use the "#" character, as it is not allowed to have empty lines (this can lead to unnecessary locks);
  • The IP address of the desired resource should be specified immediately at the beginning of the line, without indenting;
  • It is necessary to specify two types of blocked sites – with and without specifying www.


The last thing to note about this topic is that if the changes you made do not work, but they meet the above recommendations, try clearing the DNS cache by running the command "ipconfig /flushdns" in the command-line console running as administrator.

Add comments