Searching for how to block websites? Well everyone wants to block unwanted websites to keep there network clean even parents want to block websites to keep their children away from dirty stuffs.
In the previous tutorial, I have already covered how to open blocked sites, so today we will be covering how to block websites on your computer or laptop. So to make this task easier, I came up with a very simple method that anyone can use to block websites on their PC.
How to Block Websites in Windows?
- Go to the Start Menu and search for the Notepad.
- Right-click on Notepad and click on Run as Administrator.
- Now go to file ➝ open. In the file name option enter the file location given below and click the open button.
- Now it will open hosts file and it looks something like this:
- So here’s the tricky part, scroll at the bottom of the hosts file, and add 127.0.0.1 followed by the website URL that you want to block.
For Ex – Suppose I want to block geeksgyaan.com so I’ll add the following line:
- Now similarly on the new line, we can again add more websites and in this way, we can block ‘n’ number of websites as shown below.
- Save your hosts file and now whenever you try to access those sites it will show Webpage not available.
Watch Video Tutorial
How Blocking Websites Works?
Using hosts file we can also redirect one website to another which means we can redirect facebook.com to youtube.com. We just need to replace 127.0.0.1 with the Ip address of the website that we want to redirect.
Hope you are able to block unwanted websites, If you have any doubts then feel free to ask in comments.