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.
Other Stories :
- How To Apply For A Schengen Visa From Ghana
- Death Makes Nonsense Of Everything’ – Bishop Dag Speaks On Son’s Death
- Ghana’s Debt-To-GDP Ratio Hits 84.6% in 2022 – IMF Forecasts
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.
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.