How to Block a website in all web browsers

Author: Randy Alexander
Date Of Creation: 25 April 2021
Update Date: 1 July 2024
Anonim
How to Block a Website in all Web Browsers
Video: How to Block a Website in all Web Browsers

Content

This wikiHow teaches you how to block all browsers from accessing a specific website on a Windows or Mac computer by editing the "hosts" file. Alternatively, while you can't block websites on Android platforms, you can still do this on your iPhone or iPad using the Restrictions menu in the Settings app.

Steps

Method 1 of 3: On Windows

  1. Open the Start menu

    .
    Click the Windows logo located in the lower left corner of the screen, or press the key ⊞ Win.
    • On Windows 8, you have to hover your mouse pointer over the top-right corner of the screen and then click the magnifying glass icon.
  2. Type Notepad Go to Start. The Notepad application will appear at the top of the Start menu window.
  3. Right click Notepad and choose Run as administrator (Execute under an administrator). This option will open Notepad as administrator. If you do not open Notepad as administrator, you will not be able to edit the "hosts" file.
    • On laptops with a touchpad that replaces a traditional mouse, tap it with two fingers instead of a right click.
  4. Click Yes when asked to confirm your decision and open Notepad.
  5. Click File (File) and select Open (Open).
  6. Double-click the drive (C:) then go to Windows> System32> drivers> etc. Double-click each folder until you get to the "etc" directory.
  7. Click the "Text Documents" drop-down menu and select All Files (All Files). You will see a lot of file types appear in the window.
  8. Double-click the "hosts" file. Notepad will open the file "hosts" and then, you can view and edit the file contents.
  9. Scroll to the bottom of the "hosts" file. You should see two lines of text "localhost" here.
  10. Click below the last line of text. This line could have something like ":: 1 localhost" or "127.0.0.1 localhost" and was at the bottom of the page. You must place your mouse pointer just below the last line of text on this page.
    • Be careful not to delete any existing content in the hosts file.
  11. Type 127.0.0.1 then press Tab ↹. This is the computer's own loopback address. The computer will respond with an error page in the web browser when someone tries to access the blocked page.
  12. Type in the website address you want to block. For example, if you want to block Google, type www.google.com.
  13. Press ↵ Enter. This will move the mouse pointer to a new line. The code you just entered will tell the computer to redirect the web page to the alternate loop address.
    • You can add as many websites as you want, one line per page, using the same sequence number (127.0.0.1).
  14. Click File then choose Save (Save). So all browsers on your computer will not be able to access the website that you have added to the hosts file. advertisement
  • To unblock a page, just open the hosts file in Notepad as administrator again and delete the line containing the page you added. Make sure you save your changes after removing the lines you want, otherwise the website will still be blocked.

Method 2 of 3: On a Mac computer

    Launch Spotlight


    Click the magnifying glass icon located at the top right of the screen.
  1. Type terminal into Spotlight. Terminal will appear at the top of the results list.
  2. Double-click the Terminal icon

    .
  3. Type the following code into Terminal:then press ⏎ Return. The command will begin to be executed. The "hosts" file will be opened with a text editor, inside the Terminal window.
  4. Type your computer's password, then tap ⏎ Return. This is the password you use to log into your Mac.
    • Terminal will not display any characters when you enter the password.
  5. Move the blinking mouse pointer to the bottom of the page. To do this, press the key until the cursor is lower than the last line on the page.
  6. Type:127.0.0.1. This is the computer's own loop address. The computer will respond to an error page in the web browser when someone tries to access the blocked page.
  7. Press Tab ↹. The mouse pointer will move to the right.
    • Don't press ⏎ Return hurry.
  8. Enter the website address you want to block. For example, if you want to block Google, type www.google.com.
  9. Press ⏎ Return. Your computer will recognize to redirect the web page to the alternate loop address.
    • You can add as many websites as you want, one line per page, using the same sequence number (127.0.0.1).
  10. Press Control+X. This command is used to exit the hosts file in a text editor. You will be asked if you want to save your changes.
  11. Press Y to save your changes. Your computer will ask you what you want to save the file name. We need to overwrite the original hosts file, so don't change the filename.
  12. Press ⏎ Return. Changes will be saved to the hosts file. You will also exit the text editor and return to the Terminal window. So all browsers on your computer will not be able to access the website that you added to the hosts file. advertisement
  • To unblock a page, just open the hosts file in Notepad as admin again and delete the line containing the page you added. Make sure you save your changes after removing the lines you want, otherwise the website will still be blocked.

Method 3 of 3: On iPhone and iPad

  1. Open the iPhone's settings app


    .
    This is a gray app that has a gear-shaped inside and is usually located on the Home screen.
  2. Scroll down and tap General (General). This option is near the bottom on the iPhone screen, or at the top, left side of the iPad screen.
  3. Scroll down and tap Restrictions located near the middle of the General page.
  4. Enter passcodes for your restrictions. This is the passcode you still use to turn on the restriction on your device.
    • If you have not turned on a restriction, touch first Enable Restrictions (Enable Restrictions) then enter the desired passcode twice.
  5. Scroll down and tap Websites. This option is in the last section below the "ALLOWED CONTENT" heading.
  6. Click Limit Adult Content (Adult Content Limits). You will see a blue check mark appear to the right of this option.
  7. Click Add a Website (Add a Website), below the heading "NEVER ALLOW" (NEVER ALLOWED). This option is at the bottom of the page.
  8. Enter the website address you want to block. The address must start with "www" and end with the domain tag (such as ".com" or ".net"), you can skip the "https: //" part.
    • For example, if you want to block Facebook on your iPhone / iPad, you would type www.facebook.com.
  9. Press the button Done (Done) in blue in the lower right corner of the virtual keyboard. The page you selected is currently inaccessible in Safari.
    • This setting also applies on other mobile browsers like Chrome and Firefox.
    advertisement

Advice

  • IPhone Restrictions setting applies to both Safari and other web browsers on your phone.

Warning

  • Unlike the iPhone and iPad, there is no way to completely restrict website access on Android.