I've been using Freedom for this for some time. I would recommend using these tools.
When you site down and want to get something done you just block out a few hours where you can't access the sites that distract you. It is really good for focus. I thought I could do this with will power alone but these sorts of tools really do help.