I once made a list of the usual sites that distracted me from work, and black-holed them in my hosts file. At first I was amazed at how often I would reflexively attempt to visit one of those sites before remembering my self-imposed blockade.
Interestingly, I don't think it made much of a difference in my overall productivity. I find that creative output comes in waves... I have days of pure concentration and peak output, followed by lulls where I occupy myself with busywork. The blockade really only impacted the lulls, since I didn't do much browsing during productivity peaks anyway. If my productivity during the lulls improved, the gain too small to be significant, and it came with the cost of increased annoyance.
After a few months, I got rid of the blockade.