34
7
It worked for a while in the old configuration, but then stopped working for some reason.
Here is my /etc/hosts file from my Mountain Lion MacBook Air:
127.0.0.1 reddit.com www.reddit.com
127.0.0.1 facebook.com www.facebook.com
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
This blocks Reddit,but not Facebook.
I've tried flushing the DNS cache for the machine ("sudo killall -HUP mDNSResponder"), the bowsers (FF and Chrome) and I've tried restarting the computer.
And I've moved the entries to the top of the file on the advice of this article, but it didn't work before when it was at the bottom either. Each time it would block Reddit but not Facebook.
2That is odd. It also didn't work for me - I wonder if it has to do with ML's facebook integration. I'm pondering how to test that theory. – Jerry Seeger – 2013-02-01T00:52:31.790
1Searching the system folder for all mention of facebook.com found (among others) /System/Library/Caches/com.apple.internetaccounts.domainscache.plist which looked to my eye like the most likely culprit. I haven't tried messing with it, but it might be what you're looking for. I'd be really cautious, though. – Jerry Seeger – 2013-02-01T01:10:13.473
1I would agree with @JerrySeeger that's it's probably a function of the Facebook integration. That said, why are you blocking sites with such a fickle method? If you want to control internet access, get a proxy. – ta.speot.is – 2013-02-03T06:26:48.620
I only want to block it as it ruins my productivity during the day. It's not that big a deal, but more importantly I am very curious about the technical reasons I cant block it. – seanieb – 2013-02-03T07:24:08.227
In the spirit of "get a real proxy", take a look at LittleSnitch. It's payware (with a trial), but it's a really nice network/URI filtering app for OSX. You can set its filters to run on a schedule (i.e. block facebook between 8am and 5pm). And there's nothing so low-level that LittleSnitch won't block it if you ask nicely. – Zac B – 2013-02-03T07:57:07.423
I'm not looking for a proxy. – seanieb – 2013-02-03T10:31:23.577
1What happens on
dig facebook.com
ornslookup facebook.com
? – JohannesM – 2013-02-04T22:54:29.593