There are several reasons why you might want to block certain websites on your computer. Some websites could be spreading viruses, contain explicit content or even be trying to steal your personal data. While you may well be more than capable of avoiding these websites, but that doesn’t stand true for every one who uses your device. In such cases, it might be best to block certain websites. There are different ways to go about blocking websites. You can choose to block websites only on specific browsers, the entire operating system, or indeed your network router. Here’s how to block websites.
If you want to control access to websites on just one machine, then you can set up block at the operating system level. This method for blocking websites is not too hard to configure and will work across browsers.
How to Block Any Website On Windows Computers.
1. Make sure you have administrator access on your computer. Sign in to your PC using an administrator account and run d:\Windows\System32\drivers\etc\
2.Double-click the file named “hosts” and select Notepad from the list of programs to open the file. Click OK. The last two lines of your hosts file should read “# 127.0.0.1 localhost” and “# ::1 localhost”.
2a. In case you can’t edit the file, you’ll need to right-click the file labelled hosts and select Properties. Click the Security tab, select the administrator account and click Edit.
2b. In the pop-up, select the account again and check Full control. Click Apply > Yes. Now click OK in all pop-ups.
3. At the end of the file, you can add the addresses of websites to block. To do this, just add a line at the end of the file, with 127.0.0.1 and then the name of the site you want to block – this will redirect the site’s name to your local computer.
4.To block Google, for example, add “127.0.0.1 www.facebook.com” to the end of the file without the quote marks. You can block as many sites as you want this way, but remember you can only add one per line.
5. Repeat this step until you’ve added all websites you want to block.
How to Block Any Website On MAC.
1. Make sure you have administrator access to your Mac. Now open Terminal. You can find it under /Applications/Utilities/Terminal.
3. This will open the file /etc/hosts in a text editor. Type the name of the website in a new line in this format “127.0.0.1 www.google.com” (minus the quotes). For each website you want to block, start a new line and type the same command with only the name of the website being replaced.
4. Press the Control Key + “O” (the letter, not “zero”) to save the file, then close the window down. Your changes are almost in effect.
5. While still in Terminal, type in “sudo dscacheutil -flushcache” and press “enter.” This will flush the cache, allowing your changes to take place. Open a browser to test if the change went through.
If it didn’t, check out the Host file again, making sure your changes are at the end, on separate lines, and are properly formatted.
If this still doesn’t work. Restart your computer, then try the sites again. They will be blocked.
Thanks for reading the post.