aresthor

Q: Can't block websites using Terminal

Hello,

 

        I'm trying to block Facebook & YouTube in my MacBook PRO using Terminal. I followed all the steps as mentioned in various websites, but it's not working. I did the control + O & control + X thing. I tried it with both 127.0.0.1 & 0.0.0.0 as instructed. I don't want to use Parental Control.

 

Here's a screenshot:

Screen Shot 2013-02-17 at 9.33.26 AM.png

MacBook Pro, OS X Mountain Lion (10.8.1)

Posted on Feb 16, 2013 8:06 PM

Close

Q: Can't block websites using Terminal

  • All replies
  • Helpful answers

  • by Barney-15E,

    Barney-15E Barney-15E Feb 17, 2013 8:43 AM in response to aresthor
    Level 8 (49,645 points)
    Mac OS X
    Feb 17, 2013 8:43 AM in response to aresthor

    Have you restarted?

    Or, you might need to flush the DNS cache: http://support.apple.com/kb/HT5343

     

    Also, it can be finicky with the format of the lines. If it doesn't like them for some reason, it won't use them. However, it doesn't appear that is the problem from your screen shot.

  • by Mg Cipie,

    Mg Cipie Mg Cipie Mar 26, 2016 1:53 PM in response to aresthor
    Level 1 (14 points)
    Mar 26, 2016 1:53 PM in response to aresthor

    At first, Safari > Preferences > Privacy > Remove All Website Data

    Second, Terminal > sudo nano /etc/hosts 

    Screen Shot 2016-03-27 at 3.06.16 AM.png        

    Type the websites that wish to block examples: facebook !! So U need to type like that 


    127.0.0.1 www.facebook.com


    And Control+x ( to save ) and hit Enter 


    Type the below one in Terminal > sudo killall -HUP mDNSResponder