How to Edit/Modify the Hosts File in Windows 11?

Windows 11
TechLatest is supported by readers. We may earn a commission for purchases using our links. Learn more.

Want to know how you can edit or modify the hosts file in Windows 11? Then you are in the right place, continue reading.


There could be a number of reasons behind this, like you want to block some website from that particular PC, or unlock a particular port to access some work-related stuff.

We aren’t going too deep in this, we know that you are already familiar with the stuff and you just want to know the procedure to modify the host file in Windows 11.

Also, Read: Windows 11 FAQs Answered, Every Doubts Regarding the New Update

Before getting to the editing part, let’s discuss a little bit about the data structure in the host file, the file structure looks like the below statement, #test-comment

The above statement has three parts, the first part is the IP Address of the host system, by default it is, i.e., localhost. The second part is the resolved domain address of the destination, and finally third part is the comment section, which always started with the hash (#).

So, without further ado, let’s get to the exact and straightforward steps to Edit/Modify the Hosts File in Windows 11,

Also, Read: How to Download Windows 11 ISO and Clean Install it on any PC

Edit/Modify the Hosts File in Windows 11

  • Open File Explorer by either tapping Windows+E or from Start Menu.
  • Now, navigate to below address, or you can just copy the below path and paste it into the URL bar and hit Enter.
Edit/Modify the Hosts File in Windows 11
  • You will see a few files there, but we need the hosts file only.
Edit/Modify the Hosts File in Windows 11
  • Now, right-click on the file and open with any file editor. (We recommend Notepad++).
Edit/Modify the Hosts File in Windows 11
  • The Host file will be opened, and you can add or modify any data from it.
Edit/Modify the Hosts File in Windows 11

Okay, let’s take an example, with the example we will be able to understand the steps better.


Suppose, you want to block a social media website like Facebook, as it is taking a ton of your time. So, for doing so, we will have to add the following line to the hosts file. #facebook-website-block
Edit/Modify the Hosts File in Windows 11

After adding the line, save the file and exit the window. Now, if you try to open Facebook on any of your browsers it will throw an error that it can’t be reached.

Final Verdict – Edit/Modify the Hosts File in Windows 11

That was all, we have successfully learned how to edit or modify the Hosts File in Windows, we guess you were succeeded in the task you were trying to do by editing the Hosts file.

In case you didn’t understand something, or you can have any other queries regarding this article, then feel free to comment down below, we will be more than happy to assist you.


Peace ????

Also, Read: Tips to Block Adult Content on Your Windows PC

Leave a Comment
Notify of
1 Comment
Oldest Most Voted
Inline Feedbacks
View all comments