This article shows you how to block access to a specific website from any internet browser installed on your computer, including Google Chrome and Firefox. Unfortunately it is not possible to restrict access to a particular web page using the "Settings" menu of Internet Explorer, Microsoft Edge or Safari.
Steps
Method 1 of 4: Windows
Step 1. Access the "Start" menu by clicking the icon
It features the Windows logo and is located in the lower left corner of the desktop. Alternatively, press the ⊞ Win key on your keyboard.
Step 2. Type notepad keywords into the "Start" menu
A search for the "Notepad" program will be performed. It is a simple text editor built into the Windows operating system.
Step 3. Start the "Notepad" program as a system administrator
Select the program icon that appeared at the top of the search results list with the right mouse button, choose the option Run as administrator from the context menu will appear, then press the button Yup when required. The "Notepad" app will start.
- If you are using a one-button mouse, press the right side of the pointing device or press the single button using two fingers.
- If you're using a computer with a trackpad instead of a mouse, tap it using two fingers or press the lower right side.
Step 4. Access the File menu
It is located in the upper left corner of the program window. A list of options will be displayed.
Step 5. Choose the Open… item
It is located at the top of the menu File. The "File Explorer" system window will appear.
Step 6. Navigate to the Windows "etc" folder
Follow these simple instructions:
- Select the item This PC from the left sidebar of the "File Explorer" window;
- Scroll down the list of resources visible within the main pane of the window to be able to double-click the main system hard drive icon (it is normally labeled with the words [operating_system] (C:) or [computer_brand] (C:));
- Double-click on the "Windows" system folder;
- Scroll down the list of items appeared and access the "System32" folder;
- Locate the "drivers" directory and double click on the corresponding icon;
- At this point, double click on the "etc" folder icon.
Step 7. Click inside the text field containing the string "Text documents (*.txt)"
It is located at the bottom right of the "Open" dialog box. A small drop-down menu will appear.
Step 8. Choose the All Files option
It is one of the items listed in the drop-down menu that appeared. At this point, several files should have appeared in the main frame of the "Open" window.
Step 9. Enable access to the "hosts" system file
Identify it in the list that appeared in the "Open" window of the "Notepad" program, then follow this series of instructions:
- Select the "hosts" file icon with the right mouse button;
- Choose the option Property from the context menu that will appear;
- Access the card Safety;
- Push the button Edit;
- Select the "Allow" check button of the "Full Control" item;
- Push the button OK, then choose the option Yup when required;
- Now press the button OK.
Step 10. Select the "hosts" file
Click the icon with the left mouse button.
Step 11. Press the Open button
It is located in the lower right corner of the "Open" dialog box. The contents of the "hosts" file will be displayed within the "Notepad" text editor.
Step 12. Add a new line of text to the end of the file
Place the text cursor at the end of the last line of the document and press the Enter key.
Step 13. Add the information of the website you want to block
To prevent access to a web page or an entire domain from any browser on your computer, follow these instructions:
- Type the IP address of the "localhost" network interface 127.0.0.1 and press the Tab key ↹;
- Enter the URL of the website to be blocked but excluding the "www" prefix (for example "facebook.com");
- Press the Enter key to create a new line of text below the current one, then repeat the previous two steps for any other sites or web pages you want to block access from your computer.
Step 14. Block Google Chrome from accessing the sites indicated by following this procedure
While the steps indicated above block access to the addresses entered in the "hosts" file by most of the most popular browsers, in the case of Chrome it is necessary to act in a slightly different way. To block access to a website by Google Chrome, use the following URL format "www. [Site_address].com" and insert it after the one already present in the format "[site_address].com" previously entered.
- For example, to prevent access to the Facebook website, you will need to enter the following line of text at the end of the "hosts" file 127.0.0.1 facebook.com www.facebook.com.
- To increase the probability that the indicated site is actually blocked, you can also add the prefix "http:" or "https:" (in this case the previous example would take the following form 127.0.0.1 facebook.com https:// www. facebook.com.
Step 15. Try blocking access to a website using different address formats
- IP address - find the IP address of the website in question and use it in place of the URL in the "hosts" file to prevent users from using it to circumvent the restrictions you have created.
- Mobile sites - to block access to the mobile version of a particular website as well, add the prefix "m." to the URL (for example "m.facebook.com" instead of "facebook.com").
Step 16. Replace the existing "hosts" file with the one you just edited
Follow this procedure:
- Access the menu File located in the upper left corner of the "Notepad" editor window;
- Choose the option Save with name…;
- Open the "Save as type" drop-down menu, then choose the option All files;
- Select the "hosts" file listed in the main pane of the "Save as" window;
- Push the button Save, then select the option Yup when required.
Step 17. Empty the DNS client cache
To perform this procedure use the Windows "Command Prompt". In this way the information present in the cache of the DNS service will be deleted, preventing the data stored in the browser from coming into conflict with the restrictions just entered in the "hosts" file.
Step 18. Restart all currently running browsers
If you are using an internet browser, close the corresponding window and restart it. Any websites that you have blocked access to by entering them in the "hosts" file should no longer be reachable from your computer.
If you are still able to access the pages and websites listed in the "hosts" file after restarting your browser, try to fix the problem by restarting your computer
Method 2 of 4: Mac
Step 1. Enter the Spotlight search field by clicking the icon
It features a magnifying glass and is located in the upper right corner of the screen. A small search bar will appear.
Step 2. Type the terminal keyword into the Spotlight search bar
A search for the "Terminal" app will be performed on your Mac.
Step 3. Double-click the "Terminal" program icon
It should have appeared at the top of the search results list. The "Terminal" system window will appear.
Step 4. Open the "hosts" file
Type the command sudo nano / etc / hosts in the "Terminal" window and press the Enter key.
Step 5. Provide your Mac login password
Type in the security password you use when you log in to your Mac, then hit the Enter button. The contents of the "hosts" file will be displayed in the "Terminal" window.
When entering a password in the "Terminal" window, the characters entered will not be visible. This is a safety procedure
Step 6. Move the blinking text cursor to the end of the document
Repeatedly press the directional arrow ↓ on the keyboard until you reach the end of the last line of text displayed on the screen, then press the Enter key.
Step 7. Add the information of the website you want to block
To prevent access to a web page or an entire domain from any browser on your computer, follow these instructions:
- Type the IP address of the "localhost" network interface 127.0.0.1 and press the Tab key ↹;
- Enter the URL of the website to be blocked but excluding the "www" prefix (for example "facebook.com");
- Press the Enter key to create a new line of text below the current one, then repeat the previous two steps for any other sites or web pages you want to block access from your computer.
Step 8. Block Google Chrome from accessing the sites indicated by following this procedure
While the steps indicated above block access to the addresses entered in the "hosts" file by most of the most popular browsers, in the case of Chrome it is necessary to act in a slightly different way. To block access to a website by Google Chrome, use the following URL format "www. [Site_address].com" and insert it after the one already present in the format "[site_address].com" previously entered.
- For example, to prevent access to the Facebook website, you will need to enter the following line of text at the end of the "hosts" file 127.0.0.1 facebook.com www.facebook.com.
- To increase the probability that the indicated site is actually blocked, you can also add the prefix "http:" or "https:" (in this case the previous example would take the following form 127.0.0.1 facebook.com https:// www. facebook.com.
Step 9. Try blocking access to a website using different address formats
- IP address - find the IP address of the website in question and use it in place of the URL in the "hosts" file to prevent users from using it to circumvent the restrictions you have created.
- Mobile sites - to block access to the mobile version of a particular website as well, add the prefix "m." to the URL (for example "m.facebook.com" instead of "facebook.com").
Step 10. Save your changes and close the text editor
Once you have successfully entered all the websites to be blocked, save the changes made to the "hosts" file and close the editor by pressing the key combination Control + O and pressing the Enter key.
To close the text editor used to make changes to the "hosts" file, press the key combination Control + X
Step 11. Clear your Mac's DNS cache
Type the command sudo killall -HUP mDNSResponder in the "Terminal" window and press the Enter key. This will clear the contents of the DNS client cache, ensuring that the data stored on your computer relating to the websites you visit will be removed. At this point you should no longer be able to reach the websites indicated in the "hosts" file using the browsers installed on the Mac.
If the indicated sites are still reachable, restart your Mac for the new changes to take effect
Method 3 of 4: Google Chrome
Step 1. Go to the "Chrome Web Store" page of the Block Site application
This is where you can install the "Block Site" extension within Chrome.
The Block Site program allows you to block access to individual web pages or entire domains. It also allows you to set a security password so that other people who use the computer in question cannot change the program settings
Step 2. Press the + Add button
It is blue in color and located at the top right of the current "Chrome Web Store" page.
Step 3. Press the Add Extension button when prompted
It will appear at the top of the browser window as soon as the compatibility checks are completed. This will install the Block Site extension on Chrome.
Step 4. Click the Block Site app icon
It features a small shield and is located at the top right of the Chrome window, next to the address bar. A small drop-down menu will appear.
Step 5. Choose the Edit block sites list option
It is one of the items listed in the menu that appeared. The Block Site configuration page will be displayed.
Alternatively, you can click the gear icon in the upper right corner of the drop-down menu that appeared to access the same Block Site page
Step 6. Enter the URL of the site to be blocked
Type it in the "Enter a web address" text field at the top of the new tab that appears after clicking it with the mouse.
If you need to block access to a specific page on a website, view it in your browser, then copy the full URL by clicking the address bar and pressing the hotkey combination Ctrl + C (on Windows) or ⌘ Command + C (on Mac)
Step 7. Press the + button
It's located to the right of the text field where you typed the URL to block. The indicated page or website will be immediately included in the list of addresses to be blocked by the Block Site extension.
At any time, you can re-enable access to a particular website by accessing the page in question of the Block Site extension and clicking the red circular icon on the right of the URL to be removed from the list of blocked ones
Step 8. Go to the Password Protection tab
It is located on the left of the Block Site configuration page.
Step 9. Select the "Require a password to access Block Site menu" checkbox
This will allow you to set a security password to access the extension's configuration settings.
If you want, you can also select the check button "Enable password access to blocked pages" to ensure that access to the list of blocked websites is also protected by a password
Step 10. Scroll down the page and enter your chosen password
Type in the field that appears at the bottom of the page, bearing in mind that it must be at least 5 characters long.
Step 11. Press the Set Password button
It is located to the right of the text field where you entered the password. This way, in order to access the configuration menu of the Block Site extension, you will need to provide the newly created security key.
- When you access the Block Site configuration tab in the future, you will need to provide the newly created password in order to add or remove an address from the list of websites blocked by the program.
- If you forget the password to access the Block Site configuration page, you will need to uninstall it by clicking the corresponding icon with the right mouse button and choosing the option Remove from Chrome present in the context menu that will appear.
Step 12. Enable the Block Site extension to run even while browsing incognito
One of the methods that users have at their disposal to circumvent the limitations imposed by the Block Site extension is to use Chrome's incognito mode. To solve this problem, just activate the program even during this mode:
- Push the button ⋮ of Chrome;
- Choose the option Other tools;
- Click the entry Extensions;
- Push the button Details placed in the "Block Site" extension box;
-
Activate the gray slider "Allow incognito mode"
moving it to the right.
Method 4 of 4: Firefox
Step 1. Launch Firefox
Double-click the blue globe icon surrounded by an orange fox.
Step 2. Go to the Firefox store page for Block Site
This is where you will be able to install the extension within your browser.
Step 3. Press the + Add to Firefox button
It is blue in color and is placed in the center of the page that has appeared. In order to locate and select it, you may need to scroll the contents of the browser window down.
Step 4. Press the Install button when prompted
It will appear at the top of the window. The Block Site extension will be installed automatically within Firefox.
Step 5. Click the Block Site app icon
It features a small orange shield and is located at the top right of the Firefox window, next to the address bar. A small drop-down menu will appear.
Before continuing, you may need to select the option Got it from the menu that appeared.
Step 6. Choose the Edit block sites list option
It is one of the items listed in the menu that appeared. The Block Site configuration page will be displayed.
Alternatively, you can click the gear icon in the upper right corner of the drop-down menu that appeared to access the same Block Site page
Step 7. Enter the URL of the site to be blocked
Type it in the "Enter a web address" text field at the top of the new tab that appears after clicking it with the mouse.
If you need to block access to a specific page on a website, view it in your browser, then copy the full URL by clicking the address bar and pressing the hotkey combination Ctrl + C (on Windows) or ⌘ Command + C (on Mac)
Step 8. Press the + button
It's located to the right of the text field where you typed the URL to block. The indicated page or website will be immediately included in the list of addresses to be blocked by the Block Site extension.
At any time, you can re-enable access to a particular website by accessing the page in question of the Block Site extension and clicking the red circular icon on the right of the URL to be removed from the list of blocked ones
Step 9. Click on Password Protection
This button is located on the left side of the Block Site configuration window.
Step 10. Select the "Require a password to access Block Site menu" check button
This will allow you to set a security password to access the extension's configuration settings.
If you want, you can also select the check button "Enable password access to blocked pages" to ensure that access to the list of blocked websites is also protected by a password
Step 11. Scroll down the page and enter your chosen password
Type in the field that appears at the bottom of the page, bearing in mind that it must be at least 5 characters long.
Step 12. Press the Set Password button
It is located to the right of the text field where you entered the password. This way, in order to access the configuration menu of the Block Site extension, you will need to provide the newly created security key.
- When you access the Block Site configuration tab in the future, you will need to provide the newly created password in order to add or remove an address from the list of websites blocked by the program.
- If you have forgotten the Block Site security password, you will need to uninstall the extension from Firefox. Push the button ☰ browser, choose the option Additional components from the menu that will appear, then press the button Remove located on the right of the Block Site box visible in the "Extensions" tab.