

Fortunately, there have already been temporary solutions (SelfControl) that can temporarily block websites on your Mac. If you’re looking for a more ‘permanent’ solution, enter these commands in Terminal:

Open up Terminal in /Applications/Utilities. In the command line, type in "sudo nano /etc/hosts" . When asked, type your admin password. In the screen that will appear, you’ll see the host database for your computer. Using your down arrow, go to the bottom, right under where it says, "127.0.0.1 localhost" . Type in "127.0.0.1 hit ‘tab’, then enter facebook.com”. On a new line, type in "127.0.0.1" hit ‘tab’, then enter www.facebook.com" ; this is for extra measure. Now, hold down Control + “O”. This will save the changes to the host database. Hit “Return” and then Control + “X” to exit the screen. Remove the existing cache by typing in "sudo dscacheutil -flushcache" in the command line, this refreshes the existing cache on the host database. You should receive an “Unable to connect” error message when you go to Facebook.com now. Now, back to doing something more productive…

screenshots: 1 2-3 4-7 10 11