• About
  • Contact
  • Cookie
  • Disclaimer
  • Privacy Policy
  • Change the purpose of use

Tnhelearning.edu.vn - Various useful general information portal

  • Photo
  • Bio
  • How To
  • Tech

How to Block a Website on All Web Browsers

February 12, 2024 by admin Category: How To

You are viewing the article How to Block a Website on All Web Browsers  at Tnhelearning.edu.vn you can quickly access the necessary information in the table of contents of the article below.

X

This article is co-authored by a team of editors and trained researchers who confirm the accuracy and completeness of the article.

The wikiHow Content Management team carefully monitors the work of editors to ensure that every article is up to a high standard of quality.

This article has been viewed 3,889 times.

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

Table of Contents

  • Steps
    • On Windows
    • On a Mac computer
    • On iPhone and iPad
  • Advice
  • Warning

Steps

On Windows

Open the Start menu

How to Block a Website on All Web Browsers

{“smallUrl”:”https://www.wikihow.com/images_en/0/07/Windowsstart.png”,”bigUrl”:”https://www.wikihow.com/images/thumb/0/07/ Windowsstart.png/30px-Windowsstart.png”,”smallWidth”:460,”smallHeight”:460,”bigWidth”:30,”bigHeight”:30,”licensing”:”<div class=”mw-parser-output “></div>”}

. Click the Windows icon located in the lower left corner of the screen or press the ⊞ Win key.

  • On Windows 8, you have to hover your mouse pointer over the upper right corner of the screen and then click the magnifying glass icon.
Type Notepad into Start. The Notepad application will appear at the top of the Start menu window.
Right click on Notepad and select Run as administrator . This option will open Notepad as administrator. If you don’t open Notepad in administrator mode, you won’t be able to edit the “hosts” file.

  • On a laptop with a touchpad that replaces the traditional mouse, tap the touchpad with two fingers instead of a right-click.
Click Yes when asked to confirm your decision and open Notepad.
Click File and select Open .
Double click on the drive (C: ) then go to Windows > System32 > drivers > etc. Double-click each folder until you reach the “etc” folder.
Click the “Text Documents” drop-down menu and select All Files . You will see a variety of file types appear in the window.
Double-click the “hosts” file. Notepad will open the “hosts” file and then you can view and edit the file’s content.
Scroll to the bottom of the “hosts” file. You should see two lines of “localhost” text here.
Click below the last line of text. This line can say “::1 localhost” or “127.0.0.1 localhost” and is at the bottom of the page. You must place the mouse pointer just below the last line of text on this page.

  • Be careful not to delete any existing content in the hosts file.
READ More:   How to Be Beautiful in Your Boyfriend's Eyes
Type 127.0.0.1 and then press Tab ↹ . This is the computer’s own loopback address. The computer will respond with an error page on the web browser when someone tries to access the blocked page.
Type in the address of the website you want to block. For example, if you want to block Google, type www.google.com .
Press ↵ Enter . This will move the mouse pointer to a new line. The code you just entered tells the computer to redirect the web page to the alternate loop address.

  • You can add as many websites as you want to block, one per line, using the same number sequence (127.0.0.1).
Click File and then select Save . So all browsers on your computer will not be able to access the website that you added to the hosts file.

  • To unblock a site, simply open the hosts file in Notepad as administrator again and delete the line containing the page you added. Make sure you save the changes after removing the lines you want, otherwise the site will still be blocked.

On a Mac computer

Launch Spotlight

Mac Spotlight

{“smallUrl”:”https://www.wikihow.com/images_en/e/ea/Macspotlight.png”,”bigUrl”:”https://www.wikihow.com/images/thumb/e/ea/ Macspotlight.png/30px-Macspotlight.png”,”smallWidth”:460,”smallHeight”:460,”bigWidth”:30,”bigHeight”:30,”licensing”:”<div class=”mw-parser-output” “></div>”}

.Click the magnifying glass icon located at the top right of the screen.

Type terminal into Spotlight. Terminal will appear at the top of the list of results.
Double-click the Terminal icon

Mac Terminal

{“smallUrl”:”https://www.wikihow.com/images_en/1/14/Macterminal.png”,”bigUrl”:”https://www.wikihow.com/images/thumb/1/14/ Macterminal.png/30px-Macterminal.png”,”smallWidth”:460,”smallHeight”:460,”bigWidth”:30,”bigHeight”:30,”licensing”:”<div class=”mw-parser-output” “></div>”}

.

Type the following code into Terminal:

sudo nano /etc/hosts

then press ⏎ Return . The command will begin to be executed. The “hosts” file will be opened with a text editor, inside a Terminal window.

Type the computer password and then press ⏎ Return . This is the password you use to log in to your Mac computer.

  • Terminal will not display the characters when you enter the password.
READ More:   How to Study Well for the English Exam
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.
Type: 127.0.0.1 . This is the computer’s own loop address. The computer will respond with an error page on the web browser when someone tries to access the blocked page.
Press Tab ↹ . The mouse pointer will move to the right.

  • Don’t press ⏎ Return in a hurry.
Enter the address of the website you want to block. For example, if you want to block Google, type www.google.com .
Press ⏎ Return . The computer will recognize to redirect the web page to the alternate loop address.

  • You can add as many websites as you want to block, one per line, using the same number sequence (127.0.0.1).
Press Ctrl + X . This command is used to exit the hosts file in a text editor. You will be asked if you want to save the changes.
Press Y to save the changes. The computer will ask what you want to save the file name. We need to overwrite the original hosts file, so don’t change the filename.
Press ⏎ Return . The 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 have added to the hosts file.
  • To unblock a site, simply open the hosts file in Notepad as admin again and delete the line containing the page you added. Make sure you save the changes after removing the lines you want, otherwise the site will still be blocked.

On iPhone and iPad

Open the iPhone’s settings app

iPhone Settings App Icon

{“smallUrl”:”https://www.wikihow.com/images_en/7/7e/Iphonesettingsappicon.png”,”bigUrl”:”https://www.wikihow.com/images/thumb/7/7e/ Iphonesettingsappicon.png/30px-Iphonesettingsappicon.png”,”smallWidth”:460,”smallHeight”:460,”bigWidth”:30,”bigHeight”:30,”licensing”:”<div class=”mw-parser-output” “></div>”}

. This is a gray app with a gear inside and usually located on the Home screen.

Scroll down and tap General . This option is located near the bottom on the iPhone screen, or on the top, left side of the iPad screen.
Scroll down and tap Restrictions near the middle of the General page.
Enter a passcode for your restrictions. This is the passcode that you still use to enable restrictions on your device.

  • If you haven’t enabled restrictions, tap Enable Restrictions first and then enter the desired passcode twice.
READ More:   How to Be Independent
Scroll down and tap Websites . This option is in the last section below the “ALLOWED CONTENT” heading.
Tap Limit Adult Content . You will see a blue checkmark appear to the right of this option.
Click Add a Website , under the heading “NEVER ALLOW”. This option is at the bottom of the page.
Enter the address of the website you want to block. The address must start with “www” and end with a domain tag (such as “.com” or “.net”), you can omit the “https://” part.

  • For example, if you wanted to block Facebook on your iPhone/iPad, you would type www.facebook.com .
  • Click the blue Done button in the lower right corner of the virtual keyboard. The page you selected will now be inaccessible on the Safari browser.

    • This setting also applies to other mobile browsers such as Chrome and Firefox.
  • Advice

    • Your iPhone’s Restrictions settings will apply to both Safari and other web browsers on your phone.

    Warning

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

    This article is co-authored by a team of editors and trained researchers who confirm the accuracy and completeness of the article.

    The wikiHow Content Management team carefully monitors the work of editors to ensure that every article is up to a high standard of quality.

    This article has been viewed 3,889 times.

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

    Thank you for reading this post How to Block a Website on All Web Browsers at Tnhelearning.edu.vn You can comment, see more related articles below and hope to help you with interesting information.

    Related Search:

    Related Posts

    How to Create Curved Text in Photoshop
    How to fall asleep faster
    How to Install FBReader to Read eBooks

    Category: How To

    Previous Post: « Top 15 best Christmas songs of all time
    Next Post: Top 5 best red ink ballpoint pens today »

    Copyright © 2025 · Tnhelearning.edu.vn - Useful Knowledge