Resolved Problem with hosts file

Discussion in 'macOS' started by Blubble, Mar 13, 2012.

  1. Blubble, Mar 13, 2012
    Last edited: Mar 13, 2012

    Blubble macrumors newbie

    Joined:
    Mar 13, 2012
    #1
    Hello everyone,

    After years of struggling with my internet addiction I decided to completely block the websites that ruined my productivity the most. The best trick I found for doing that was to edit the hosts file (note: I use OS X 10.6.8) with the line:

    127.0.0.1 www.example.com


    However I have been unable to block Youtube, the mother of all time-wasting sites. I tried all forms of the URL, I double checked several times, but it still doesn't work, whereas all other websites do. I use Chrome, but the blocking doesn't work on Safari either so I am confident that the issue does not lie with the browser itself.

    Any tips? I can't tell whether this issue is with OS X or the website itself.
     
  2. r0k macrumors 68040

    r0k

    Joined:
    Mar 3, 2008
    Location:
    Detroit
    #2
    The hosts file you need to edit is /private/etc/hosts.

    An alternative would be to consider setting up a dns based filter scheme. This would allow you to set your own blacklist as well as block entire categories of questionable content such as phishing sites, malware sites, games or whatever you think you need to live without. Then of course you have to practice some self control not to undo your dns settings. One provider is opendns.
     
  3. Blubble, Mar 13, 2012
    Last edited: Mar 13, 2012

    Blubble thread starter macrumors newbie

    Joined:
    Mar 13, 2012
    #3
    Thank you for your reply. Your solution is elegant, however I discovered that I cannot switch to opendns due to the internet access policy of the place where I live. So for now I am stuck with the host file.

    I looked at the file again and it is indeed /private/etc/hosts. As I said before, all other sites seem to work, it's just Youtube that remains stubbornly accessible. :D

    EDIT: I have done some more tinkering and solved the problem on my own. Thanks for your time.
     

Share This Page