Help needed with blocking websites

Discussion in 'macOS' started by shoichi, Mar 1, 2010.

  1. shoichi, Mar 1, 2010
    Last edited: Jan 27, 2011
  2. r0k macrumors 68040


    Mar 3, 2008
    What you are doing is a brute force approach to blocking sites. You are editing your "/etc/hosts" file to add blacklisted sites to it.

    The syntax for the hosts file is as follows:
    ip_address hostname

    If you want to block www and, you will need 2 entries on the same line: www www

    Note: I had to insert blanks between www and to prevent vbulletin from turning everything into links. :rolleyes:

    This isn't foolproof because somebody could always simply enter www2 and get around your blacklist.

    Be very careful when editing /etc/hosts! Do not simply delete /etc/hosts to undo all your changes. You can render your machine incapable of connecting to the local network or the internet! I suggest you look for another approach to blacklisting web sites.

    For your reference, here is the default /etc/hosts in case you want to get back to the way it should be...

    # Host Database
    # localhost is used to configure the loopback interface
    # when the system is booting.  Do not change this entry.
    ##	localhost
    A better blacklist method might be to use a dns based filtering service like opendns. Read everything carefully and be sure to follow all their directions. Also make a note of your current dns settings before chaning over to theirs in case you break something and need to go back. If you break something, you will need access to the net to get help fixing it so proceed methodically and slowly and write everything down so you can go back to where you were before you started. Opendns allows you to block sites by category, ie violence or adult content. You can also whitelist sites that you don't want blocked and blacklist sites you do want blocked.
  3. HenryAZ macrumors 6502a


    Jan 9, 2010
    South Congress AZ
    You might want to try GlimmerBlocker. It works as an http proxy attached to your network interfaces.
  4. lannister80 macrumors 6502


    Apr 7, 2009
    Most routers today have a built-in site blocking mechanism.

    Then you can control which computers can access what (based on IP).

Share This Page