Hit Subscribe!

Don’t Be a Noob, Subscribe Already!

How-To

How to Find and Edit the Hosts File in Windows 11 (Block Websites)

On Windows 11, you have multiple ways to block time-consuming or distracting websites. For example, if you use Google Chrome, you can install extensions to block websites. Or else, you can use third-party software or make rules in the firewall to prevent specific sites from opening on your device.

While we have different methods to block websites, the most popular and the best option is editing the Hosts file. However, the problem with restricting websites via the Hosts file is that the file is hidden deep under the system installation folder, and editing it requires administrator access.

How to Find and Edit the Hosts File in Windows 11 (Block Websites)

However, once you know the process, things will become much easier. Hence, if you are interested in finding and editing the host files in Windows 11 to block specific websites, you have landed on the right page. Below, we have shared a step-by-step guide on finding and editing host files in Windows 11. Let’s get started.

How to Find the Hosts File in Windows 11

As mentioned above, the host file in Windows 11 resides deep in the System 32 folder. Finding host files in Windows 11 could be complicated, but you can make things easy by knowing the exact path.

1. First, open the File Explorer on your PC and double-click on your system installation drive.

2. On the System installation drive (usually Local Disk (C:)), double click on the Windows.

WindowsWindows

3. On the Windows folder, find and double-click on the system32 folder.

system32system32

4. On the system32 folder, find the drivers folder. If you can’t find the driver’s folder, utilize the search option to find it.

5. On the driver’s folder, double-click on the, etc folder.

double click on the etc folderdouble click on the etc folder

6. On the etc folder, click on the view button on the top bar and select Show > Hidden items. Now you will find a file named Hosts.

file named 'Hosts'file named 'Hosts'

That’s it! This is the host file that you need to edit to block websites.

How to Block Websites Using Hosts File?

If you want to block websites using the host file, you first need to log in to your administrator account on Windows 11. If you don’t want to use the administrator account, you can grant the administrator permission to the user account you are using.

Before editing the Hosts file, copy the original file to a safe location. Next, double-click on the Hosts file and select Notepad to open the file.

select Notepadselect Notepad

If you want to block any website, you need to add a line at the bottom of the host file. The line you need to add is:

0.0.0.0 facebook.com

0.0.0.0 facebook.com0.0.0.0 facebook.com

The above line will block the Facebook website on your device. You can add as many websites to the host file as you want. The web address should appear after 0.0.0.0

Once done, click on the File button and select the ‘Save‘ option. That’s it! This will block the website on your Windows 11 PC.

click on the File button and select the 'Save' optionclick on the File button and select the 'Save' option

If you want to unblock the website, you need to delete the line you have added in the host file. Or else, you can add # at the beginning of the line to convert the syntax into a comment.

delete the line you have addeddelete the line you have added

That’s it! This is how you can edit the host file in Windows 11 to block websites. Now whenever you try to visit the site, you will see a screen like the one below.

host file in Windows 11host file in Windows 11

So, that’s all about how to find and edit the hosts file in Windows 11. If anything goes wrong, you need to replace the edited hosts file with the original one you copied before. If you have any doubts about this, let us know in the comments below.

Source

 

Hey there! Just so you know, we’re an Amazon affiliate. This means if you buy something through our links, we may earn a small commission. It doesn’t cost you extra and helps keep our lights on. Thanks for supporting us!”

Avatar

Geeks Gadgets

About Author

Leave a comment

Your email address will not be published. Required fields are marked *

Productivity & Shortcuts

xbox parental control settings
How-To

How to set up parental controls on your Xbox Series X|S

Set parental controls for your children and have peace of mind when they’re gaming
image of laptop displaying the windows 11 2020 update on office desk
How-To

How to roll back Windows updates

We’ll show you how to roll back Windows updates in several ways.

Add A Knowledge Base Question !

You will receive an email when your question will be answered.

+ = Verify Human or Spambot ?