Well, there are a few possibilities here:
1) if you need a quick solution then use your hosts file:
put lines like
0.0.0.0
www.hotmail.com
0.0.0.0
www.badsite.com
in the hosts file in the /etc/ folder. You need root access to do this. This works by telling your PC that the IP address of hotmail is 0.0.0.0 when it clearly isn't --> can't connect to hotmail.
2) Use PeerGuardian by adding the IP ranges you want to block to your own list. [
http://www.methlabs.org]
3) I imagine this is also possible using IPtables, but I've never tried, so don't know how.