Introduction
In this article, we are explaining how to block any website in Windows 8. There may be times when it is necessary to block a website for privacy, due to any website content or simply to avoid websites that use a large amount of bandwidth. In the previous version of windows when you want to block a website then we can simply modify the HOSTS file. But in Windows 8 you can't modify the HOSTS file directly. Windows 8 takes a new approach to the host file by default. It won't allow us to block a website by modifying the HOSTS file.
In Windows 8 one of many changes Microsoft has provided is a native anti-virus program called Windows Defender. One of the things this security program does is protect the HOSTS file from modification. For most users this protection by Windows Defender is a good thing; it prevents malware from hijacking your HOSTS file without your knowledge. For users that want to modify the HOSTS file, however, this is a roadblock in blocking websites with the HOSTS file. If you want to modify the host file to block a website you first have to exclude the HOSTS file from Windows Defender security.
If you are using Windows 7, Vista or XP then you do not need to exclude the HOSTS file from Windows Defender. You can directly modify the HOSTS file using Notepad.
Notepad must be run as an Administrator.
How to block a website in Windows 8?
Step 1
Go to the search box and enter "Windows Defender" and click on the application that appears.
Step 2
Windows Defender will be opened. In Windows Defender go to the "Settings" tab.
Step 3
In the Settings tab click on "Excluded files and Locations".
Step 4
In this step click on "Browse" and navigate to "C:\Windows\System32\Drivers\etc\HOSTS". Select "HOSTS" and click on "OK".
Step 5
Now click on "Add" and then click on "Save changes". It may ask for confirmation; then click on "YES".
Step 6
In this step exit from Windows Defender. Now go to the search box and enter "Notepad" and right-click on the Notepad icon and select "Run as Administrator".
Step 7
In Notepad go to the File tab and select "Open".
Step 8
In open windows navigate "C:\Windows\System32\Drivers\etc\HOSTS". Click on HOSTS and click on "Open". In file type "All Files" must be selected.
Step 9
The HOSTS file will be opened in Notepad. Go to the "127.0.0.1 localhost" line at the end of the HOSTS file.
Step 10
In this step add a line for each website you want to block. Type the number 127.0.0.1, followed by a space or tab, and then type the name of a website, as in the following example. Finally "Save" to the HOSTS file and exit from it.
Step 11
After saving the HOSTS file, restart your computer and try to open the website. You will be blocked from it.
Summary
In this article, we learned about How to Block Websites in Windows 8.