Block access to a website

Discussion in 'Mac Basics and Help' started by kerpow, Feb 27, 2007.

  1. kerpow macrumors 6502

    Jan 16, 2004
    I wan to block access to a website on a Mac. In the Windows world the simplest way to do this is to open the Hosts file and add a fake DNS entry for the site eg.

    Your average user will have no idea how to fix this.

    Whats the simplest way to do this on a Mac without having to buy software?
  2. 4np macrumors 6502a


    Feb 23, 2005
    The Netherlands
    The same: by editting /etc/hosts....

    A weird thing in a mac though is that the lookup order is different than on your average windows machine; if you want to use the hosts file to overrule a domain name you should also change the lookup order. You can do this by executing the following commands:


    and restart lookupd by executing a:

    If you don't want to edit your hosts file and the lookup order, you can use the netinfo manager (in applications/utilities).

    If you want to do this company wide you could add an entry to your local DNS server (if you run one).
  3. eddorey2k3 macrumors newbie

    Feb 27, 2007
  4. kerpow thread starter macrumors 6502

    Jan 16, 2004
    Figured it would be some file or other to edit. I'll give that a go.

  5. djdawson macrumors member


    Apr 28, 2005
    This is no longer needed in Tiger, and I don't think it was necessary in 10.3, either. I've never bothered with the lookup order and I put stuff in my /etc/hosts all the time. It just works.

  6. bubbleboy450 macrumors newbie

    Dec 8, 2007
    Youtube Addict

    I am sure that there are lots of other people trying to do the same thing. I don't want anyone on my computer to be able to access youtube, or facebook. I have tried editing my hosts file
    sudo pico /ect/hosts (some recomend, sudo nano....)
    i put in

    Also have tried

    and everyother combination of spaces, and tabs imaginable.

    then hit crtl-o to save, and press y. All it says is "bus error" and doesn't save it. pressing crtl-x does the same thing. No mater what i do, it always says, "bus error".
    Any ideas how i can get youtube baned from my computer for good? Making a second account is not an option.
    P.s Using leopard. 10.5.1

Share This Page