Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do I go about blocking websites using Sudo in Terminal?

Nobody in the Kenwood Towne Center locations seems to know how or they are to scared. I came here so that if anything went wrong they would be the ones responsible & it under warranty not me.

MacBook Pro (13-inch Late 2011), Mac OS X (10.7.3)

Posted on May 26, 2012 7:09 AM

Reply
18 replies

May 26, 2012 7:16 AM in response to AugustusPrimus

Sudo is not a tool that you would use to block websites. I'm guessing that you're looking for directions for blocking sites by editing the hosts file, but note that that is a poor solution, and not adviseable for anyone who is not already comfortable with the Terminal.


I would advise using OpenDNS, which is free and offers site blocking features.

May 26, 2012 8:16 AM in response to AugustusPrimus

You can use


sudo pico /etc/hosts


and arrow down to the bottom of the existing file (change nothing there) and add


0.0.0.0 www.somesitehere.com



to block, and then press Control X, Y + return to save and exit.


User uploaded file



However for more sites/entires it's better to use the free TextWrangler as it can edit the /etc/hosts file in a more GUI like manner, paste longer information etc.


I use a 16,000 plus hosts file modification to block a lot of the crap of the Internet, been deciding to write a user tip, if it's too risky as messing around with this system level file is dangerous.

May 26, 2012 9:26 AM in response to AugustusPrimus

Do not mean to be a stuck up ungrateful unappreciative brat but Mister Reed no duh it is not adviseable, but how is anyone ever going to learn without experiencing? Mister Davis I was talking about responsibility in the store I am under no impression that Apple is responsible for this website heck it may not even be on one of it's own servers. You guys do not have to be so technical, political, & judgemental. What I want to do is completly block inappropriate websites for example playboy to name one of the hundreds if not thousands of pornagraphic websites that a curious teenager would adventure to. Thank you ds store!

May 26, 2012 9:50 AM in response to AugustusPrimus

AugustusPrimus wrote:


What I want to do is completly block inappropriate websites for example playboy to name one of the hundreds if not thousands of pornagraphic websites that a curious teenager would adventure to.


I answered your original question, however since adult content websites number in the hundreds of thousands, new ones created everyday, it would be unrealistic to use the hosts file for this.


My list is only 16,000 and generated by thousands of IT workers, the amount of adult content online is well in excess of being managed except by a population of say New York City working on it 24/7 to get it all catagorized.




If you subscribe to OpenDNS, they do have a decent adult content filtering system, but it's not perfect at all as I tried it, it does a good job of blocking a lot of accidential visits to major known sites, but not if one is smart, learns the bypass trick from a friend or/and their intent is to find that material as it's everywhere.




OpenDNS may slow down your downloads of Apple/Akamai based content which uses the closet ISP server to download to you.


You need to check your location that OpenDNS has a server near your location or experience slow or problematic downloads.


You can search Wikipedia for OpenDNS, their server locations are there, if your ISP server is very near the same city, then you should't experience a delay in downloading from Apple/Akamai servers.



If I'm talking too geek speak, then just copy my post for later and likely it will make sense if you run into a problem.



https://www.opendns.com/home-solutions/

May 26, 2012 9:43 AM in response to AugustusPrimus

AugustusPrimus: It's not "hundreds or thousands" of **** sites. More likely it's hundreds OF thousands, and hundreds more every day. Lotsa luck keeping a teenager away from them all. That'll be like keeping your yard dry by running around trying to catch raindrops one at a time. By blocking access to even a few of the major sites at home, you'll just encourage the kid to use a friend's computer instead.

May 26, 2012 9:45 AM in response to AugustusPrimus

Mister Reed no duh it is not adviseable, but how is anyone ever going to learn without experiencing?


So, then, do you have to stick your hand into a garbage disposal and turn it on in order to learn that you shouldn't do that? Criticizing someone who advises you not to do that is ridiculous.


If you choose to edit the hosts file, you can certainly do that, but you may end up making your Mac completely unable to connect to the internet. Besides which, how do you suppose you're going to build and constantly maintain a list of all the bad sites out there that you don't want your teenager using?


As I already recommended, use OpenDNS. That is free, requires installation of no software and can block whatever sites you want. You can even configure your wireless router to use OpenDNS and block access to those sites on any device on your wireless network.

May 26, 2012 9:56 AM in response to thomas_r.

Thomas A Reed wrote:


I've never heard such a claim before, nor has that been my experience as a user of OpenDNS. Do you have a source for this claim?


Your one of the fortunate that has a OpenDNS server nearby, or no in between line issues. Unlike Grant who is in Boston and has to use NY OpenDNS servers.


http://apcmag.com/why-using-google-dns-opendns-is-a-bad-idea.htm


https://en.wikipedia.org/wiki/OpenDNS


You can follow the discussion about Grant's OpenDNS problem here in the Lounge (sorry others not allowed, Level 6+ only)


https://discussions.apple.com/thread/3971890?start=0&tstart=0

May 26, 2012 10:19 AM in response to Linc Davis

If your teenager is tech-savvy enough enough to figure that out, there's nothing you'll do to keep them away from such sites. And as you pointed out earlier, they can always just go to a friend's house or use a public wifi hotspot. Parenting does not involve any absolute solutions, but OpenDNS (or some other site blocker) can be used effectively as a part of your parenting.

May 26, 2012 10:26 AM in response to Linc Davis

Linc Davis wrote:


Any halfway-intelligent teenager would know, or could find out, how to bypass the controls imposed by OpenDNS.


Kids chat among themselves and can get the IP address of the site they want to visit or find it online and then paste it into the browser URL and press enter to go there.


So OpenDNS is a solution until the kid learns how to get around it, but that's all.


Teenagers, are certainly wise enough to employ such a method as soon as they learn their favorite site is blocked.


Unless OpenDNS is using the results from the Great Firewall of China in their content filtering there is no way they can afford to hire enough people to censor the Internet.

How do I go about blocking websites using Sudo in Terminal?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.