How to Block Websites on Computer

You want to block a website, for whatever reason, this is a simpler operation than you think. Although it requires some code, but it is mainly copy and paste, all internet browsers allow you to block individual websites easily. Make sure you understand the instructions well before proceeding. Note: You need 'Administrative' permission to make the changes below. That is, you must be the primary user of the computer and know the password.

Block websites on Windows

Picture 1 of How to Block Websites on Computer

Open My Computer and find the "C:" drive. To block the website on any browser, you need to access and edit the "HOST" file. This file helps you to convert URLs such as www.google.com to a digital DNS address. However, with just a little tweaking, you can use this switch to block computers from accessing specified websites.

If you don't see a "Windows" folder in your C: drive, try looking elsewhere. Usually we install Windows on the C drive, but sometimes you also choose another drive if you install Windows yourself.

Picture 2 of How to Block Websites on Computer

Find the "etc" folder in the drive. Go to Windows -> System32–>drivers–>etc. In the etc folder, find the file "Hosts".

The location you are aiming for is C:/WINDOWS/system32/drivers/etc. You can enter this path in the top bar in My Computer if the etc folder is not found.

You can find it by typing "notepad C:/Windows/System32/drivers/etc/hosts" into the Command Prompt window. To use the Command Prompt, find and open the program in the Start menu.

Picture 3 of How to Block Websites on Computer

Open the file "hosts" with Notepad. Double click on the Hosts file and choose open with Notepad. That way you can edit files and block specific websites.

If you don't see an option to open with Notepad, open the Notepad program. Then click on "File" → "Open" in Notepad and find the Hosts file like in the previous step. Click on the file to open it.

Picture 4 of How to Block Websites on Computer

Drag down the space at the end of the file. You'll see lots of code and text, but you don't have to touch them. Scroll to the bottom and find the line "127.0.0.1 localhost".

Do not edit or change anything. This file is extremely important when connecting to the internet, you just need to add a few lines at the end of the text to block the website.

Picture 5 of How to Block Websites on Computer

Press enter to create a new line at the end of the text. Start a new line just below the "localhost" line.

Picture 6 of How to Block Websites on Computer

Block the site by entering the web URL after "127.0.0.1". At the beginning of the line, you type 127.0.0.1, press the spacebar and then type the URL of the website. For example, to block Google, you would type "127.0.0.1 www.google.com".

Do not add "http://" in front of the URL, so you will not block the website.

Picture 7 of How to Block Websites on Computer

Add other websites to block with separate lines. If you want to block multiple websites, just press "enter" to get a newline. Type 127.0.0.1 and the website URL. This method does not limit the number of blocked pages.

Picture 8 of How to Block Websites on Computer

Save file. After blocking the page, click "File" → "Save". Close the browser if you're using it, then reopen it. The site will be blocked on all browsers.

Block websites on Mac

Picture 9 of How to Block Websites on Computer

Open Terminal. This is the program with which you can make administrative changes to your Mac. Use the search bar or look in Finder /Applications/Utilities/Terminal.

Terminal has a black window icon with white letters. It allows you to execute code on the computer.

Picture 10 of How to Block Websites on Computer

Copy the current hosts file in case it's edited by mistake. Although it hasn't changed much, it's still best to back it up. To do it automatically, enter the command 'sudo /bin/cp /etc/hosts /etc/hosts-original' into the Command Line and press "enter".

You may be asked to enter the administrator password. This is the password used to open the device when it is just booted.

Picture 11 of How to Block Websites on Computer

Open the hosts file. Type 'sudo nano /etc/hosts' and press "enter" to open the "hosts" file in another window. This is the file that needs editing to block the website. Scroll down, skip to the bottom line (usually a phrase with "localhost").

Picture 12 of How to Block Websites on Computer

Start new line with 127.0.0.1. This is the line that tells the computer the website to block. Type the number and press the spacebar.

Picture 13 of How to Block Websites on Computer

Add the website you want to block after the number. You enter the URL of the website after the space, starting with www. For example, if you want to block Google, type "127.0.0.1 www.google.com". Don't forget to type in a separate line.

Do not add "http://" in front of the URL.

Picture 14 of How to Block Websites on Computer

Add more pages to each line separately. If you want to add a page, press enter and then type 127.0.0.1, the way, the website's URL. The computer will completely block this website on all browsers.

Picture 15 of How to Block Websites on Computer

Save file. Press the Control Key + "O" (the letter O, not the "zero") to save the file, then close the window. The changes are about to take effect.

Reset the cache to apply the change. In Terminal, type 'sudo dscacheutil -flushcache' and press "enter". This is a cache cleanup that allows you to apply changes. Open a browser to check if the change has taken effect.

If not, check the hosts file again, make sure you change it at the bottom of the page, in a separate line, and in the correct format.

If it still doesn't work. Restart the machine and load the page again. This time the computer will block the website.

Block websites on separate browsers

Internet Explorer

Picture 16 of How to Block Websites on Computer

Open Internet Explorer. Internet Explorer (IE), Microsoft's browser allows you to block websites without taking too much action. However, these changes will not affect other browsers, such as Firefox.

Picture 17 of How to Block Websites on Computer

In the top menu, click Tools > Internet Options. You will see a settings window that allows you to adjust the pages to block. There are many tabs at the top of the window where you can adjust settings.

On newer versions of IE, you'll see a wheel icon instead of "tools". Click on the wheel, select "Security Settings".

Picture 18 of How to Block Websites on Computer

Click on the Privacy tab, click on "sites." Type in the address of the website you want to block and click OK. With this method, you can only block one website at a time.

On newer versions of IE, you must click on "Restricted Sites" > "Sites".

Picture 19 of How to Block Websites on Computer

Use a Microsoft account to block specific websites on the new IE browser, aka Edge. To block websites on the new version of Internet Explorer, which has been overhauled and renamed "Edge", you need a Microsoft account. As such, you can adjust your online preferences to block any website from your account.

To do this, go to https://account.microsoft.com/family/about?refd=windows.microsoft.com

Mozilla Firefox or Google Chrome

Picture 20 of How to Block Websites on Computer

Open a web browser. Firefox and Chrome do not have a built-in website blocking feature, you can download the free plug-in for easier operation.

On Chrome, you need to go to the Chrome Web Store. On Firefox, add-ons are called "Add-ons".

Picture 21 of How to Block Websites on Computer

Access the selection of add-ons you need. Click on the 3 gray horizontal bars in the right corner of Firefox browser, select "Add-Ons" to access parental control options or block websites. On Chrome, click the "Apps" button in the upper-left corner of the screen, then click "Web Store".

Picture 22 of How to Block Websites on Computer

Find and download the appropriate plug-in. Mozilla has a handy page of the best parental controls and website blocking features here. If only regular web blocking, you can choose "BlockSite".

If you're looking for a more powerful program, search for "parental controls or filters" on the online store or add-on library. These programs have special controls so they can block all kinds of websites, similar to a dark web filter.

Once downloaded, the plug-in will be activated and ask which sites you want to block.

If the plug-in cannot be found, click on the 3 horizontal bars in the corner and select "Add-ons" (Firefox) or "Extensions" (Chrome).

Safari

Picture 23 of How to Block Websites on Computer

Open Safari and click on the Apple icon in the upper right corner of the screen. You will see settings and options appear. Safari doesn't block websites, but rather restricts the websites you choose more tightly.

Picture 24 of How to Block Websites on Computer

Select System Preferences and look for Parental Controls. This function allows you to block websites and set yourself a "parent account" to know what other people can access on Safari.

Picture 25 of How to Block Websites on Computer

Click on "Convert this account to a parental controls account." (Convert this account to a parent account). This requires you to enter the administrator password -- the account used to log into the computer at startup. After entering the password, you will see the Parental Controls window.

Picture 26 of How to Block Websites on Computer

Click on "Web" > "Allow access to only these websites." (Only allow access to these websites). This is the action that starts the limited functionality on Safari. You can add pages with "+" and "Add Bookmarks".

To regain full control, simply uncheck "allow access to only these websites".

Update 25 February 2022
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile