Benches macOS

1

Blocking website

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

How do I block a specific website on my computer?

1 reply

Sign in or join Beachball Help to reply.

  1. 0

    Kappy

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    There are several ways. Depends on where and why you want the site blocked. If you want to block sites in Safari you can install the shareware PithHelmet -
    VersionTracker or
    MacUpdate - and configure it to block any specific site. Or you can install a special .css file that is pre-configured to block a whole slew of sites, but you can add to the list. You will find it at
    http://www.floppymoose.com/ (look for UserContent.css.) You then configure Safari's preferences (Advanced) to use the file.

    For system-wide blocking you can download a shareware utility
    Hostal. If you are so inclined you can simply edit the Unix 'hosts' file via the Terminal application and add URLs to it that you wish to be blocked. To do this:

    Open the Terminal application in your Utilities folder. At the prompt (which looks like this: YourComputerName:~ username$) enter (press return at the end of each line):

    cd /etc

    ls hosts

    You should see a listing of the hosts file. Now enter:

    sudo pico hosts

    You will be prompted to enter your password which will not be echoed. When the editor opens you should see what looks like this:

    ##
    # Host Database
    #
    # localhost is used to configure the loopback interface
    # when the system is booting. Do not change this entry.
    ##
    127.0.0.1 localhost
    255.255.255.255 broadcasthost
    ::1 localhost

    Add the URL of the site you want to block as follows:

    ##
    # Host Database
    #
    # localhost is used to configure the loopback interface
    # when the system is booting. Do not change this entry.
    ##
    127.0.0.1 localhost
    127.0.0.1 http://www.xxx.yyy
    255.255.255.255 broadcasthost
    ::1 localhost

    If you have more than one site simply press return and continue to add sites one per line. When you are finished press CTRL-X. You will be asked if you want to save changes. Answer 'y' and press return at next prompt. The editor will quit. To verify your changes enter:

    cat hosts

    If all is OK you can quit Terminal and restart the computer. When you try to access the site from your browser it should no longer be accessible.