Banning domains temporarily from local access
I highly recommend the app SelfControl:
http://selfcontrolapp.com

You can use either a whitelist or a blacklist of websites and you can set it for a specified time limit. It's great for either blocking the sites you know will tempt you, or allowing only certain sites you know you'll need. 

You can also edit the hosts file at /private/etc/hosts to block sites. Here is a site with instructions:
http://www.mactip.net/how-to-edit-the-hosts-file-on-a-mac/


  Similarly, it’s possible to block a harmful domain by mapping it to the localhost. Thereby preventing the computer from reaching the domain. In this situation, map the bad domain to 127.0.0.1. It will not be able to connect.


So all you have to do is add a line like this:

127.0.0.1    badwebsite.com


to your hosts file.