Click the magnifying glass icon in the upper-right side of your Mac's screen. A text box will appear. This will search your computer for the Terminal app. It should be the top option in the Spotlight search results. Doing so will open the Terminal app. Type in sudo nano /etc/hosts and then press ⏎ Return. Type in the password that you use to log into your Mac, then press ⏎ Return. The "hosts" file will open. Terminal won't show your password's letters as you type. Press the ↓ key until the cursor is at the end of the last line of text on the page, then press ⏎ Return. To block a website in your computer's browsers, do the following:  Type in 127.0.0.1 and press Tab ↹. Type in a website's address without the "www" section (e.g., "facebook.com"). Press ⏎ Return to start a new line, then repeat the above two steps with other addresses you want to block. While you can block sites in most browsers using the above step, Google Chrome is slightly different: if you're blocking sites on Google Chrome, you'll need to place a space and then the "www.[site].com" version of the website's address after the "[site].com" version.  To block Facebook, for example, you would type in 127.0.0.1	facebook.com www.facebook.com. Adding the "http://" or "https://" part of the address as well (e.g., 127.0.0.1	facebook.com https://www.facebook.com can improve the chances of the site being blocked. IP address — You can find a website's IP address and then block it in the "hosts" file to prevent people from accessing the website via its IP address.  Mobile site — By placing "m." in front of a website's address (e.g., "m.facebook.com" instead of "facebook.com"), you can block the mobile version of the website as well. Once you have entered all of the sites that you want to block, save and exit by pressing Control+O and then pressing ⏎ Return. To exit the hosts file, press Control+X. Type in sudo killall -HUP mDNSResponder and press ⏎ Return. This command will flush your Mac's DNS cache, which will ensure that all of the website's previous data (e.g., saved passwords) is erased. Your listed site should now be blocked in all browsers on your computer. If your computer's browsers don't block the site, restart your computer to finalize the changes.

Summary:
Open Spotlight . Type terminal into Spotlight. Double-click  Terminal. Open the "hosts" file. Enter your Mac's password. Move the blinking cursor down to the bottom of the page. Add websites to the block list. Block Google Chrome sites using this method. Try blocking alternative versions of the website's address. Save and exit the editor. Flush your computer's DNS cache.