In Windows 11, it is possible to modify the HOSTS file. A hosts file is a local file stored on the computer that translates domain names or NetBIOS names into an IP address.
When an IP address is looked up, the computer first looks in the hosts file to convert the name. If the name is not in the local hosts file, it tries to resolve it using a Domain Name Service (DNS), and if the name is not found either, the lookup fails.
The hosts file is located in the c:\windows\system32\drivers\etc\ directory and can only be edited by an administrator. A standard user account cannot edit the hosts file.
By default, editing the hosts file is not necessary. However, it can help when moving a domain name or blocking an app or website. In addition, it’s relatively simple to edit the hosts file. Here’s how it works.
How to modify the HOSTS file in Windows 11
You need to open a text editor as an administrator to edit the hosts file. In this example, I am using “Notepad”.
Click “File” and then “Open” in Notepad.
Go to the location:
Then in the open window, change the “Text Documents (*.txt)” option to “All Files”.
You will now see the “hosts” file. Click on it and open the file so you can edit it.
At the bottom, on a new line, enter what you want. For example, this could be an IP address pointing to a domain name.
When you are done, press CTRL + S to save the HOSTS file. Do you get an error message? Then you have not opened Notepad as an administrator. Close Notepad if you succeed.
I hope this has helped you. Thanks for reading!