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.
First, you may be under the impression that you're getting official support from Apple here. That's not the case. Apple explicitly disclaims responsibility for the information on this site.
Second, it's not clear what you want to do. If you want to filter out ads on web pages, I suggest the ad-blocking proxy called "GlimmerBlocker."
You can use
sudo pico /etc/hosts
and arrow down to the bottom of the existing file (change nothing there) and add
to block, and then press Control X, Y + return to save and exit.
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.
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!
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.
According to a quick search I just did, there were about 4.2 million "inappropriate" websites in 2007. There must be many more now, and of course, they're changing all the time. Each entry in the hosts file will block exactly one. So make sure you set aside enough time for your project.
Otherwise, use Parental Controls.
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.
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.
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.
You can follow the discussion about Grant's OpenDNS problem here in the Lounge (sorry others not allowed, Level 6+ only)
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.