Blocking domains?

Discussion in 'Mac Apps and Mac App Store' started by Derek~san, May 25, 2004.

  1. Derek~san macrumors newbie

    Joined:
    Aug 4, 2003
    #1
    Alright, I have people who use my laptop at school, and there are sites that they frequent that I'd prefer them not going to. Is there any way I can block the websites from being accessed? I know in Windows there is something called a "host file", or something like that that can do something along these lines. Any ideas?
     
  2. SilentPanda Moderator emeritus

    SilentPanda

    Joined:
    Oct 8, 2002
    Location:
    The Bamboo Forest
    #2
    Yup. As long as you have admin rights to the Mac.

    Open up Terminal.

    Then type (I use Pico so kill me): su pico /etc/hosts

    It'll ask you for your password. Then edit the hosts file (an example is given). For instance, to block www.google.com just type:

    0.0.0.0 www.google.com

    You might also have to add google.com so that both are blocked although I'm not sure. I use my hosts file to get rid of all the ads that are shown with my Hotmail (I don't need *any* form of adult friend finder!).
     
  3. Derek~san thread starter macrumors newbie

    Joined:
    Aug 4, 2003
    #3
    Thanks, that worked, abliet having to use sudo in place of su. su wouldn't accept my admin password (and yes, I am the computer's administrator). Also, a friend of mine was telling me to use 127.0.0.1 so that the request never even leaves your computer. Seems to work just as well, in any case.

    Also, thanks to this little exercise in Unix, I can now use vi. (emacs is teh suck :D) ^_^
     
  4. SilentPanda Moderator emeritus

    SilentPanda

    Joined:
    Oct 8, 2002
    Location:
    The Bamboo Forest
    #4
    Ahhhh... you're right. It is sudo instead of su. And 127.0.0.1 does make sense to use instead.

    I don't use vi or emacs. I can never figure out how to quit them! :)
     
  5. Derek~san thread starter macrumors newbie

    Joined:
    Aug 4, 2003
    #5
    Well, it takes a little getting used to. vi is much than emacs in regards to things like that though, as long as you know how to do it.
     

Share This Page