how to block a website

There are quite a lot of reasons why you would want to block websites on your computer. Maybe, you want your employees to stay away from social media websites. Or you simply want your kids to stay away from sensitive websites. However, no matter what purpose is, the question is how to block websites?

Well, in case if you have a similar question in your mind, then I am here to help you out. In this article, I am going to talk about different steps that you will need to follow to block websites on your computer. So here we go:

How to block websites?

There are two methods that will help you to block websites on your PC. The first one is to use Parental controls, and the other one is to use host files.

However, let me just mention both of the ways one by one:

Method 1: Using parental controls

how to block a website

Both the Windows and MacOS have built-in parental controls that you can use. As a result, it will be easy to block what websites you do not wish to access on your system. Parental control features comes within your PC features only. Also, you can install third party software for the job. Anyway, let me just explain the steps to you one by one:

Parental Controls in Windows 10

Step 1: The first thing you need to do is set up a different account for your Computer. You can do it by going to the Windows 10 settings menu.

Step 2: After that, click on Accounts.

Step 3: Next, click on the Family & other people tab and click the button labeled as Add someone else to the PC.

Step 4: Now, you will need to enter the required information.

Step 5: After that, go to your Microsoft account page and select a web browsing table and check the box labeled as Only see websites on the allowed list.

Step 6: Over here, you will find an option that says Always allow these and Always block these. Enter URLs of the websites that you wish to block on your Computer. And finally, click on the block button, and you are all done.

Using parental controls in MacOS

how to block a website

Windows is not the only operating system that helps you with parental controls. You can also use parental controls feature in MacOS too to block websites. To start using the feature, you will need to follow the below steps:

Step 1: First of all, open System Preferences and click on the button that says Parental Controls.

Step 2: After that, your Mac will ask you to create a new profile with parental controls. So simply fill in all the details.

Step 3: Next, if your current profile is password protected, then you will need to enter your password. And once you are done creating a profile, you have to select the Parental Controls and click the Web tab.

Step 4: Over here, you can either only allow a few websites for the other users to use. Or you can simply block websites by clicking on the customize button.

Step 5: To add a website that you wish to block, you will need to click on the addition sign under the Never allow heading and enter the address of the site you want to block. Now, enter as many websites as you want to block. (One line per domain.)

Step 6: Once you are done finishing it, click on the OK button located at the bottom right corner.

Method #2: Altering host files

Block using Windows hosts file

how to block a website

If you only wish to block a specific websites on Windows, then it is a pretty easy job and completely free to use process. Also, it does not require you to set up any accounts or download any software.

All you have to do is make some changes in the Windows hosts file on your computer. The host’s file is a plain text file on your Windows computer that your computer uses for mapping IP addresses and hostnames. And you can use it to redirect a domain name back to the local computer.

However, before you go ahead, you should keep in mind that to do this, you will need to have administrator privileges. And it will be a bit of a complicated process. Anyway, you can follow these steps here:

Step 1: First of all from the Windows Explorer, go to this following path: C:\Windows\System32\drivers\etc.

Step 2: Now, you have to double click on the hosts and select Notepad when prompted to choose a program to open the file with. You can also launch Notepad at first and then navigate to the host file.

Step 3: In Notepad, you will get to see a bunch of lines of texts which are used for mapping purpose. And I would recommend you not to alter any of the texts.

Now all you have do is hit the enter button. After that, you have to type down 127.0.0.1 and give a space and then type down the website that you wish to block.

So it will look like as:

127.0.0.1 www.facebook.com

127.0.0.1 www.youtube.com

Just make sure to add one domain per line, and you will be good to go. Also, make sure to use www only and avoid http or https.

Step 4: Once you are done adding all the websites that you wish to block, you have to click on the File option from the upper menu and save it. Also, make sure not to change the file name or save location. Also, if you get any warnings, simply ignore that.

Step 5: Finally, you will need to open a web browser and try to visit the website that you have just blocked. And see if it is working for you or not. You may also need to restart your computer for the changes to happen.

Using MacOS hosts file

how to block a website

Blocking websites using MacOS is pretty similar to blocking websites on Windows. The process is absolutely straightforward and completely free. And you do not require to install any software all. And here are all the steps that you will need to follow:

Step 1: At first, launch the terminal by accessing the main application folder. Also, you can use the spotlight option to look for the feature.

Step 2: Now, you will need to make a copy of the host’s file. So in case if it gets messed up, you will be able to reset.

Step 3: Simply type down sudo /bin/cp /etc/hosts /etc/hosts-original on the Terminal command line to make a backup file.

Then simply hit the enter button and type in your admin password when asked.

Step 4: After that, you have to type down sudo nano /etc/hosts and hit Enter on the Terminal command line to open up your hosts file in a nano box. Then, enter your administrative password when prompted.

Step 5: Once the host file gets opened, over here, you will find several lines of texts which are being used for mapping purposes. However, under the last line, you need to place and enter and start typing down 127.0.0.1 and then give a space and type down your website name.

So it will look like:

127.0.0.1 www.facebook.com

127.0.0.1 www.youtube.com

Step 6: Once you are done doing so, hold down the Control key and press O to save the changes. Then, hold down the Control key and press X to exit the hosts file.

Step 7: After that you have to type down sudo dscacheutil -flushcache and press Enter again to flush your existing cache and put the changes into effect. Or you can simply restart your computer.

Finally, check if the changes are made or not, and you are good to go.

Method #3: Using your router settings

how to block a website

If you want to block websites across your network, then using your router settings would be a great idea. This would allow you to set the settings for all the computers and devices on your network. And you do not have to configure each of the devices individually.

However, this cannot be done with all the routers out there. But there are routers that come with parental controls. And if your router got it too, then you can use this feature.

Anyway, for this, you will need to follow these steps:

Step 1: First of all, open your router’s web interface. Most of the routers can be accessed by using 192.168.1.1 in your browser’s address bar and typing in a username and password.

Step 2: Then, you will need to navigate to the router security panel tab, which features blocking controls. The security options are typically under something called Access Restrictions or Content Filtering. So do look for such options.

Step 3: Once you are done discovering such options, you will have to enter the websites that you wish to block.

Step 4: Finally, save the settings, and you are all done.

Final Words:

So that was the answer to your how to block websites‘ question. Now it is your call to go ahead and check out the steps and see how they are working for you. Also, if you have any more questions to ask, then do feel free to comment below and I will surely help you out.

Author