4 Ways to Block a Website in All Browsers

Table of contents:

4 Ways to Block a Website in All Browsers
4 Ways to Block a Website in All Browsers
Anonim

This article shows you how to prevent access to a specific website from any internet browser installed on a Windows or Mac computer by modifying the system "hosts" file. On iOS devices, you can block access to a website using the "Restrictions" feature in the Settings app. Android device users can use the free BlockSite application to block access to a particular website or prevent the use of specific apps.

Steps

Method 1 of 4: Windows

987876 1
987876 1

Step 1. Access the "Start" menu by clicking the icon

Windowsstart
Windowsstart

It features the Windows logo and is located in the lower left corner of the desktop. Alternatively, you can press the ⊞ Win key on your keyboard.

If you're using Windows 8, move your mouse cursor to the top right corner of the screen and select the magnifying glass icon

987876 2
987876 2

Step 2. Type in your notepad keywords

Windows will search your computer for the "Notepad" program.

987876 3
987876 3

Step 3. Select the Notepad icon with the right mouse button, then choose the option Run as administrator.

This way the program will run using the computer administrator account privileges. "Notepad" must be open in administrator mode, otherwise you will not be able to edit the "hosts" file.

If you are using a computer with a trackpad instead of a mouse, tap it using two fingers or press the lower right side to simulate pressing the right mouse button

987876 4
987876 4

Step 4. Press the Yes button when prompted

This will confirm your willingness to use the "Notepad" program as a system administrator.

987876 5
987876 5

Step 5. Access the File menu and choose the voice You open….

It is one of the items on the drop-down menu File.

987876 6
987876 6

Step 6. Navigate to the folder where the "hosts" file is stored

Use the dialog You open to perform the following instructions:

  • Select the item This PC listed inside the left sidebar of the window;
  • Double-click the icon of the computer's main hard drive (usually indicated by the wording OS or [Device_brand] (C:)).
  • Access the folder Windows selecting it with a double click of the mouse;
  • Scroll through the list that appeared to be able to open the folder System32;
  • Locate the folder drivers and select it with a double click of the mouse;
  • At this point, access the folder etc.
987876 7
987876 7

Step 7. View all files in the folder

Access the drop-down menu characterized by the item "Text documents (*.txt)" and choose the option All files (*. *). You will see several items appear within the "Open" window.

Step 8. Enable the changes to the "hosts" file

Select it with the right mouse button and follow these instructions:

  • Choose the option Property;
  • Access the card Safety;
  • Push the button Edit;
  • Select the "Allow" check button relative to the "Full Control" item;
  • Push the button OK, then when prompted select the option Yup;
  • Push the button OK to close the "Properties" dialog box.
987876 8
987876 8

Step 9. Double click on the "hosts" file

Its content will be displayed in the "Notepad" program window. At this point you will be able to make any changes you want.

987876 9
987876 9

Step 10. Scroll to the bottom of the "hosts" file

There should be two lines of text starting with the word "localhost".

987876 10
987876 10

Step 11. Move the text cursor after the last line displayed

The latter should look like one of the following: ":: 1 localhost" or "127.0.0.1 localhost". To be able to insert a new line of text, the cursor must be after the last one already present.

Be very careful not to delete any of the content already in the "hosts" file

987876 11
987876 11

Step 12. Type the IP address 127.0.0.1 and press the Tab key ↹

This is a special address that refers to the computer's internal network interface. This way when someone tries to access one of the blocked websites within the browser an error page will be displayed.

987876 12
987876 12

Step 13. Type the URL of the website you want to block

For example, if you want to block access to the Google site you will need to enter the following text string www.google.com.

If you normally use the Google Chrome browser to browse the web, you will need to enter the URL of the site to be blocked in the following two formats, separating them with a blank space: "[site].com" and "www. [Site].com". For example, to prevent access to Facebook, you will need to enter the following line of text 127.0.0.1 facebook.com www.facebook.com

987876 13
987876 13

Step 14. Press the Enter key

This will move the text cursor to a new line. The code entered instructs the operating system to redirect all requests sent to the websites listed in the "hosts" file to the network card's loopback interface.

  • All the websites you want to block can be entered in the "hosts" file without any limit. Remember to enter a single site per line and always use the IP address 127.0.0.1 as indicated in the previous step.
  • If you want to be as accurate as possible, enter the URL of the site to be blocked in multiple formats. For example, to block access to Google, don't just enter the address "www.google.com" but also add the following variations: "google.com" and "https://www.google.com/".

Step 15. Save the changes made to the "hosts" file

By simply using the option Save of the menu File any changes you made to the "hosts" file will not be saved. To do this, follow these instructions:

  • Access the menu File;
  • Choose the option Save with name…;
  • Open the "Text Documents (*.txt)" menu and choose the option All files (*. *);
  • Select the "hosts" file;
  • Push the button Save;
  • When prompted, press the button Yup.

Method 2 of 4: Mac

987876 15
987876 15

Step 1. Enter the Spotlight search field by clicking the icon

Macspotlight
Macspotlight

It features a magnifying glass and is located in the upper right corner of the screen.

987876 16
987876 16

Step 2. Type the terminal keyword into the Spotlight search field

The "Terminal" app icon will appear at the top of the results list.

987876 17
987876 17

Step 3. Select the "Terminal" icon

Macterminal
Macterminal

with a double click of the mouse.

987876 18
987876 18

Step 4. Open the "hosts" file

Type the following code into the "Terminal" window and press the Enter key:

sudo nano / etc / hosts

987876 19
987876 19

Step 5. Enter your Mac login password when prompted

This is the same password you use to log in every time you turn on your computer. After entering it, press the Enter key.

Typing the password in the "Terminal" window you will not see any characters appear

987876 20
987876 20

Step 6. Move the text cursor to the bottom of the page

Keep pressing the ↓ key until the cursor is positioned under the last line of the page.

987876 21
987876 21

Step 7. Enter the IP address of the loopback network interface, also known as "localhost"

Enter the address 127.0.0.1 inside a new line.

987876 22
987876 22

Step 8. Press the Tab key ↹

The text cursor will move to the right one tab stop.

Don't press the Enter key for now

987876 23
987876 23

Step 9. Type the URL of the website you want to block

For example, if you want to block access to the Google site, you will need to enter the following text string www.google.com.

  • The line of code you just entered should be identical to the following 127.0.0.1 www.google.com.
  • If you want to be as accurate as possible, enter the URL of the site to be blocked in multiple formats. For example, to block access to Google, don't just enter the address "www.google.com" but also add the following variations: "google.com" and "https://www.google.com/".
  • If you normally use the Google Chrome browser to browse the web, you will need to enter the URL of the site to be blocked in the following two formats, separating them with a blank space: "[site].com" and "www. [Site].com". For example, to prevent access to Facebook, you will need to enter the following line of text 127.0.0.1 facebook.com www.facebook.com.
987876 24
987876 24

Step 10. Press the Enter key

The code entered instructs the operating system to redirect all requests sent to the websites listed in the "hosts" file to the network card's loopback interface.

All the websites you want to block can be entered in the "hosts" file without any limit. Remember to enter a single site per line and always use the IP address 127.0.0.1 as indicated in the previous step

987876 25
987876 25

Step 11. Press the key combination Control + X

This command is used to close the "hosts" file visible in the text editor. At this point you will be asked to save the changes.

987876 26
987876 26

Step 12. To save the changes made to the "hosts" file press the Y key

You will be asked what name you want to use for saving. Since you want the changes to be made to the original file, do not change the name that is automatically proposed to you.

987876 27
987876 27

Step 13. Press the Enter key

Any changes made to the "hosts" file will be saved. The Command Prompt text editor will close and you will be automatically redirected to the "Terminal" window. All websites that you have entered in the "hosts" file will be unreachable using any browser installed on your computer.

Method 3 of 4: iOS devices

987876 28
987876 28

Step 1. Launch the iPhone Settings app by clicking the icon

Iphonesettingsappicon
Iphonesettingsappicon

It is characterized by a gray colored gear. Normally it is placed directly on the Home of the device.

987876 29
987876 29

Step 2. Scroll through the menu that appeared to locate and select the General item

It is located at the bottom of the screen (on iPhone) or at the top left (on iPad).

987876 30
987876 30

Step 3. Scroll through the newly appeared menu to locate and select the Restrictions option

It is located in the center of the "General" page.

987876 31
987876 31

Step 4. Enter the access code in the "Restrictions" section of the menu

This is the numeric code you were asked to create and enter the first time you enabled the "Restrictions" feature on your iPhone or iPad.

If you've never enabled the "Restrictions" feature, tap the entry Enable restrictions and enter the security code you want. In this case you will have to enter it twice to confirm that it is correct.

987876 32
987876 32

Step 5. Scroll through the menu that appeared to locate and select Websites

It is the last item in the "Allowed Content" section.

987876 33
987876 33

Step 6. Tap the Restrict Adult Content option

On the right of the latter you will see a blue check mark appear.

987876 34
987876 34

Step 7. Select the Add a website item in the "Never allow" section

It is the last option listed on the page.

987876 35
987876 35

Step 8. Enter the URL of the website you want to block. The address in question must start with the prefix "www" and end with the domain extension (for example ".com", ".it" or ".net"). If you want, you can still leave the "https:" prefix where it already exists.

  • For example, if you want to block access to the Facebook site on your iPhone or iPad, you will need to type the following URL

    www.facebook.com

987876 36
987876 36

Step 9. Press the Finish button

It is blue in color and is located in the lower right corner of the keyboard. At this point the site indicated will be inaccessible using the Safari browser.

Access restriction settings will also apply to all other browsers installed on your device, such as Google Chrome and Firefox

Method 4 of 4: Android devices

Step 1. Download and install the BlockSite app

It is a program that allows you to block access to specific websites and the execution of applications from your Android device. Log in to Play Store Google by tapping the icon

Androidgoogleplay
Androidgoogleplay

then follow these instructions:

  • Tap the search bar;
  • Type in the keyword blocksite and press the "Search" button;
  • Push the button Install positioned under "BlockSite - Block Distracting Apps and Sites";
  • When prompted, press the button I accept.

Step 2. Launch the Block Site app

Push the button You open visible on the Play Store page dedicated to the application in question or tap the shield-shaped icon of the Block Site app in the "Applications" panel.

Step 3. Press the Enable button

It is green in color and is positioned in the center of the screen.

Step 4. Press the GOT IT button when prompted

This will redirect you to the "Accessibility" menu of the Android device in the Settings app. However, if this is not the case, please follow these instructions before continuing:

  • Launch the app Settings;
  • Scroll through the menu and choose the option Accessibility;

Step 5. Enable the Block Site app in the "Settings" menu of the device

Use the "Accessibility" menu and follow these instructions:

  • Tap the item BlockSite;
  • Activate the gray cursor next to "BlockSite"

    Android7switchoff
    Android7switchoff

    moving it to the right.

Step 6. Open the Block Site app again

If you have closed or minimized the program window, you will need to reopen it before you can continue.

Step 7. Tap the + button

It is located in the lower right corner of the screen. You will be redirected to the page where you can enter the URLs of the websites to be blocked.

Step 8. Enter the address of the website you want to block

Tap the text field at the top of the screen, then enter the URL of the site you want to block (for example facebook.com).

Step 9. Press the button

Android7done
Android7done

It is located in the upper right corner of the screen. The inserted site will be added to the list of those blocked by the Block Site app. This way you will no longer be able to access it using Google Chrome.

You can enable access to a currently blocked website at any time by tapping the trash can icon to the right of its name

Step 10. Stop an application from running

If you need to temporarily block an app from running, press the button located in the lower right corner of the screen, choose the option Apps and select the name of the program to block.

Just like with websites, you can re-enable the use of a specific application at any time by tapping the trash can icon to the right of its name

Step 11. If necessary, block access to adult-only content

If you're looking for a way to prevent adult content from being viewed using your Android device, check out this article for more details on how to filter this type of content.

Advice

  • After modifying the "hosts" file, you should clear the DNS service cache to make the configuration change effective and avoid conflicts between the internet browser and the operating system.
  • To restore normal access to a blocked website using the "hosts" file, you simply need to open it and delete the line of text that refers to the site in question. Make sure you save the changes made to the "hosts" file otherwise access to the sites of your interest will still be blocked.
  • The "Restrictions" feature of the iOS operating system applies to both the Safari browser and all other browsers installed on the device.

Recommended: