Using hosts file to block websites... isnt working

Discussion in 'macOS' started by sOwL, Sep 27, 2009.

  1. sOwL macrumors 6502

    sOwL

    Joined:
    Sep 25, 2007
    Location:
    Nerd Cave
    #1
    My computer will be shared for a couple of weeks and there are certain websites that i need to block... Let's say i want to block facebook, heres what i did:

    Opened up terminal, then typed 'sudo nano /etc/hosts'
    Added '127.0.0.1 facebook.com' on the bottom, having them separated with TAB instead of spaces
    Pressed ctrl+o and enter to save the file, then ctrl-x to quit the nano thing.
    Then i typed 'dscacheutil -flushcache' for changes to immediatelly take place
    Quit terminal

    Am i doing something wrong here? I can still open facebook.com in Opera after those steps.... Am i missing something?
     
  2. Tex-Twil macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #2
    Hi,
    what is the result of this command

    Code:
    $ host facebook.com
    
    Tex
     
  3. sOwL thread starter macrumors 6502

    sOwL

    Joined:
    Sep 25, 2007
    Location:
    Nerd Cave
    #3
    Code:
    facebook.com has address 69.63.184.142
    facebook.com has address 69.63.176.140
    facebook.com mail is handled by 10 mx.snc1.tfbnw.net.
    facebook.com mail is handled by 10 mx.sf2p.tfbnw.net.
    
    it doesnt matter if i have facebook.com added in the hosts file or not, the result remains the same
     
  4. Tex-Twil macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
  5. ArtemissimetrA macrumors newbie

    Joined:
    Jun 2, 2009
    #5
    Wow, this is an old unresolved thread. Maybe someone will look here for an answer in the future, so might as well resolve it.

    Facebook runs on https, so you'll have to treat it as such in the hosts file.

    127.0.0.1 https://www.facebook.com

    That should do the trick. :)
     
  6. MacJoin macrumors newbie

    Joined:
    Sep 3, 2013
    #6

Share This Page