How to block a website in Windows 10 (step-by-step)

This tutorial will show you step by step how to block a website in Windows 10.

You don't need third-party software to block websites in Windows 10. You can do this by adding a few lines to the Windows host file.

The website will be blocked in all web browsers (e.g., Google Chrome, Microsoft Edge, Mozilla Firefox, Opera, etc.).

How to block a website in Windows 10 using host file

1. Open Windows Notepad as administrator.

Two ways to open Notepad as administrator:

2. When the User Account Control (UAC) window appears, you click Yes.

Note: Depending on your settings, you might need to enter your administrator password first and then click Yes.

3. Click on File located in the top left corner of Notepad, and then click on Open.

Windows Notepad open file

A “Open” window will appear.

4. Navigate to the following location on your PC: (C:) > Windows > System32 > drivers > etc.

C Windows System32 drivers etc

5. Click on Text Documents (*.txt) located in the bottom right corner of Notepad and select All Files (*.*).

Select All Files in Windows Notepad

6. Select the hosts file.

7. Click on the Open button.

Open Windows hosts file in Notepad

8. Add the following lines underneath localhost name resolution is handled within DNS itself:

127.0.0.1	www.example.com
127.0.0.1	example.com

Replace www.example.com and example.com with the website you want to block.

Block a website in Windows 10 using the host file

9. Click on File located in the top left corner of Notepad, and then click on Save.

Block a website in Windows 10 using the host file

10. Close Notepad.

The website is now blocked in all web browsers in Windows 10 by the host file.


Maybe you're also interested in:

How to unblock blocked websites