Block a website in all web browsers

Author: Morris Wright
Date Of Creation: 24 April 2021
Update Date: 1 May 2024
Anonim
How to Block a Website in all Web Browsers
Video: How to Block a Website in all Web Browsers

Content

Maybe you have a lot of discipline and want to block a website for yourself (no more guilty pleasures for you, in accordance with the New Year's resolutions). Maybe you are the proud owner of a child who scans the web for inappropriate material. Whatever the reason, this action requires modifying your Host file. Your host file is a computer file used to store information about where a computer network can find a node.

To step

Method 1 of 2: Block a website on all browsers of a PC

  1. Open Windows Explorer and type C: Windows System32 drivers / etc in. If Windows is not installed on the C drive, replace the C: with the letter of the correct drive.
  2. Double click on hosts, and open the document in Notepad when Windows prompts you. It hostsfile tells the system what to do if you want to reach a specific domain or IP address. This is the file you are going to edit.
    • If Windows automatically redirects you or if hosts is opened in another program, then open Notepad (Start -> All programs -> accessories -> Notepad) and open hosts by clicking File -> Open in the Notepad.

  3. Find the line "127.0.0.1 localhost" or ":: 1 localhost "Place your cursor at the end of the bottom of these lines.
  4. Press "Enter" to create a new line.
  5. Enter the website (s) you want to block. You can enter any site, but you must always put "127.0.0.1" in front of it.
    • For example, to block the site reddit.com, enter "127.0.0.1" followed by a single space, then "reddit.com".
    • Add all domains of the site, especially the mobile ones, and put each on a new line. For example, your computer can block "www.facebook.com", but not "m.facebook.com" if you are not careful. This is easily circumvented for experienced computer users.
  6. Click "File -> Save to save it hostsfile. If a window appears stating that you cannot save the file because you are not an administrator, then you need to change the permissions so that you are an admin too. To do this:
    • You right click on it hostsfile, you choose Properties->Security, and make sure all options are checked for your account. This allows you to save the file as admin.
    • Otherwise, you can also save the file to your desktop and drag the file to where it should be. This could work, but the method above is preferred.

Method 2 of 2: Block a website on all browsers on a Mac

  1. Open the Terminal. Go to Programs -> Utilities -> Terminal.
  2. Back up your data before making any serious system adjustment (optional). It's a good idea to back up your original one hostsfile before changing it.
    • Copy and paste the following code into the Terminal, and click Enter.
      • sudo / bin / cp / etc / hosts / etc / hosts-original
    • Terminal will warn you about this command and ask you for a password. Enter your password and press Enter. As you enter the password, it seems as if the keys are not working; they are entered invisibly.
  3. Copy and paste the following code into the Terminal. On one line, insert the following line and press Enter: sudo / Applications / TextEdit.app / Contents / MacOS / TextEdit / etc / hosts
    • The Text Editor will do it hostsfile in a separate window.
  4. Unlock it hostsfile if it isn't already. Do this by clicking next to the "Locked" (or "Secure") icon and selecting "Unlock".
  5. In the Text Editor, find the line "fe80:: 1% lo0 localhost ". Create a new line directly below by pressing Enter.
  6. Enter the website (s) you wish to block. You can add any site, but you must put "127.0.0.1" in front of it.

    • To block YouTube.com, for example: enter "127.0.0.1" followed by a single space, followed by "youtube.com".
    • Add all domains of the site, especially the mobile ones, and put each on a new line. For example, your computer may block "www.facebook.com", but not "m.facebook.com" if you are not careful. This is easily bypassed for experienced computer users.
  7. Save the file.Archive -> Save.
  8. Check if the sites are actually blocked.