You would install Squid or another program that acts like a proxy server. Any matches in the squid control list would be blocked.

http://www.freesoftwaremagazine.com/...blocking_squid

Have a look on google for other articles.
An alternative is if you have a broadband router with builtin firewall. The linksys AG241 for instance can filter web sites, without you having to setup configuration for your OS.