How To Edit Hosts File In Windows 10

In windows, hosts file is used to resolve domain and ip address mapping, so when you use a domain name in web browser or other client tool, windows will first find the domain’s related ip address in the hosts file, if find then use that ip to communicate with the server, if not find then it will query the domain’s ip from the dns server configured.

The hosts file is located in C:WindowsSystem32driversetc in windows, the file location for each windows version is same, but for windows 10, the edit method is not same as windows 7 or earlier. You may find you can not save the file when you edit it.

1. Edit hosts File In Windows 10 Errors.

When a windows user edit a text file, the normal process is right click the text file and click open with menu item to open the text file with notepad, after edit the content then click save menu item to save it.

But in windows 10, when you want to save the hosts file after edit, it will prompt below dialog that said you do not have permission to save this file, need administrator permission.

How To Edit Hosts File In Windows 10

After investigate, i found the C:WindowsSystem32driversetc folder ( that contains the hosts file ) is read only, so i attempt to change the etc folder’s read-only attribute.

How To Edit Hosts File In Windows 10

But when i uncheck the Read-only checkbox and click OK button, it prompt below error dialog also, the prompt dialog said access denied, i need administrator permission to change the read only attribute.

How To Edit Hosts File In Windows 10

2. How To Edit Win 10 hosts File Successfully.

After investigate on the internet, i finally find the method to change the hosts file content in windows 10 follow below steps.

  1. Open windows explorer, and navigate to C:WindowsSystem32, find the notepad.exe file in the file list.
    How To Edit Hosts File In Windows 10
  2. Right click the notepad.exe file, click Run as administrator menu item in the popup menu list.
  3. Open the hosts file in the notepad tool and edit ip domain mappings like below. Now you can save the file successfully.127.0.0.1 test.com
  • 69