When I'm surfing the web at home, I am easily able to use my DNS server to block content that I don't want to see on web sites. Though I'm using a Gentoo box (can't quite afford the nice Mac server I want), this hint covers this process on an OS X box.
Since I have a PowerBook and often surf the web at all sorts of places, I got to thinking of a way to do this locally. With DNS, adding a simple 'deny' entry is easy, but using someone else's DNS server usually means I don't have access to their config files.
Another way to do this is to redirect the DNS to point to a false IP address. The easy way to do this is to use /etc/hosts. By aliasing the DNS name of a site I want to block to 127.0.0.1, I can block all traffic to that site. Using sudo nano -w /etc/hosts, add the DNS names of the sites you want to block after the IPv4 localhost entry, separated by spaces.
127.0.0.1 localhost ads.site1.com ads.site2.com
255.255.255.255 broadcasthost
::1 localhost
No logout or restart is needed, just a refresh of the page. Since this blocks the site at the DNS level, this should work with any web browser.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20051110111329703