HOSTS file for any operating systems. Note that the HOSTS file only worked well in IE.
http://www.mvps.org/winhelp2002/hosts.htmFor Firefox, there's an addon known as Blocksite.
For those using Linux, the inbuilt firewall can be used to block certain websites as well.
1. Start IPTables first.
sudo service iptables start or
su service iptables start or
sudo su service iptables start, depending on your Linux distro.
2. Then add in the website you want to block:
iptables -A INPUT -s -i -d -p TCP -j DROP
If you don't know your network card interface, use the ifconfig command for wired connections and iwconfig command for wireless. It will list your interface. The one with the correct internal IP address (not loopback IP address aka 127.0.0.1) will be your network card interface. Usually is eth0 or eth1
If you use a third party firewall, some can be configured to block websites. Check their manuals.