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:
- Type notepad in the search bar, right-click on Notepad when it appears, and then click on Run as administrator.
- Click on the start menu button. Click on Windows Accessories. Right-click on Notepad, move your mouse cursor on More, and then click on Run 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.
A “Open” window will appear.
4. Navigate to the following location on your PC: (C:) > Windows > System32 > drivers > etc.
5. Click on Text Documents (*.txt) located in the bottom right corner of Notepad and select All Files (*.*).
6. Select the hosts file.
7. Click on the Open button.
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.
9. Click on File located in the top left corner of Notepad, and then click on Save.
10. Close Notepad.
The website is now blocked in all web browsers by the host file in Windows 10.
Maybe you're also interested in:
How to unblock blocked websites
How to install only security updates in Windows 10
How to hide files and folders in Windows 10 (+ view and unhide them)
How to change the color of only the taskbar in Windows 10
How to remove items from the taskbar in Windows 10
How to make the Windows 10 taskbar more or fully transparent