
So, let's get started and see how we can block select websites permanently to increase our productivity. You can of course remove a website from blocking, at a later date, if you want to do so.
Using Microsoft's Built-in Protection
Let's say your kids access a shared computer at your home and you want to block certain websites for their account. You can do so through the Microsoft account used to log in to the PC. Here's how to do it.Go to Settings → Accounts → Family and other users option.

Follow the prompts to complete the account creation process. At the end of the process, you see a newly created child account in the list as shown below.


Now, here if you'll start filtering websites and searches, by default, they'll be only applicable on the Microsoft Edge browser. If you're using any other web browser like Chrome or Firefox, the settings won't work with them.



You can add as many sites as you want by providing the URL of each one of them. It's a one-time exercise. Once configured, it gives you peace of mind that your kids are not accessing unwanted websites.
Using Hosts File Blocking Mechanism
There's another way to block websites which involves editing a special file found on almost all popular desktop operating systems. One needs to enter the website details in a specific format in this file to block them completely. Here's how to do it on Windows.Press
Windows + S
key and type notepad
in the search box.
Ctrl + O
to open the file opening dialogue box.Go to C:\Windows\System32\drivers\etc and select the
hosts
file in that directory.
hosts
file in that directory, select the All Files option to display it for selection as shown above. Now at this point, you have the hosts file opened and ready for editing.
yahoo.com
, all you need to do is to enter the IP address 0.0.0.0
followed by a space and the domain name as shown in the image above.For each website, you need to do the same on a new line. Save the file and that's it! In the future, if you ever want to access that website again, just remove its entry from the
hosts
file.On a Linux system, the method is the same differing only in the file path and the command to edit it. Here's how to do it.
For example, if you want to block
yahoo.com
on Linux, use the following command.sudo sh -c 'echo "0.0.0.0 yahoo.com" >> /etc/hosts'
Here the file path is /etc/hosts
, and the sudo
prefix is necessary to get the admin privilege required to edit that file.So, whichever method you prefer, feel free to use it to block websites on your Windows or Linux machines. I use a specialized application for the same, but you can use these techniques too.