How to modify the HOSTS file in Windows 11? This is how!

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 on search in the taskbar. Then look for the “Notepad” app and right-click on it. In the menu, then click “Run as administrator”“.

Click “File” and then “Open” in Notepad.

Go to the location:

c:\windows\system32\drivers\etc\

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.

Open HOSTS file in Windows 11

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.

edit hosts file

I hope this has helped you. Thanks for reading!

Leave a Comment

Your email address will not be published.

Scroll to Top