Windows 10

How to Block Websites On Your Computer

In this tutorial, we are going to see how to block websites on your computer. From time to time, you may see a website that you just want to block. Maybe the website is spam or just contains distractions, like Facebook. This is especially true when children are involved and spend a lot of time on these websites. If you regularly use a browser, you may have seen that there are no obvious options for blocking websites on a browser. However, you can use the hosts file to block a website on any browser.

 

 

How to Block Websites On Your Computer

To block websites on any browser, we will use the hosts file method. In the hosts file we will add the website we want to block. If you don’t know, the hosts file is used to map IP addresses to human-readable website addresses. So we will map the website we want to block to a local IP address called localhost. i.e. 127.0.0.1.

Once you map a website address to localhost, you can’t access that website. This is because every time you type the URL into the browser’s address bar, it tries to access the local host. Since localhost is just our computer, the website does not load.
 
Step 1: First, open the Start menu and search for Notepad. Now, click on the Run as administrator in the right panel. You can also right-click on Notepad and select the Run as administrator option.
 

 

 
Step 2: In Notepad we need to open the hosts file. To do this, go to File and select Open.
 

 
Step 3: The above action will open the file selection window. Here, go to C:\Windows\System32\drivers\etc folder. Once you are here, select All Files from the drop down menu at the bottom right.
 

 
Step 4: Now select the hosts file and click the Open button. This action opens the hosts file in the notepad where you can add the website to be blocked in any browser.
 

 
 
Step 5: In the hosts file, use the format below to block any websites on the browser. Don’t forget to replace example.com with the name of the website of your choice.

Note: make sure there is at least one space between the localhost IP address and the actual address of the website.

127.0.0.1 example.com


 
Step 6: You can add as many websites as you want to block on any browser. For example, Here we blocked Facebook.
 

 

 
Step 7: After adding websites to block, we need to save the changes. To do this, click on the File menu and select save. You can also press the keyboard shortcut Ctrl + S.
 

 
Step 8: After saving the file, close it by clicking on the X Icon appearing in the upper right corner.

That’s it. Now your browser blocks the website.
 

 
That’s it!
 

Leave a Reply

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