How To Block A Website On A Mac
The previous post was about how to block a website and was specific to blocking websites on Windows. But here we’ll explain how to block a website on a Mac, the process is something similar to blocking a website on Windows but with a few commands in Terminal, you can block a website on a Mac for sites on Chrome, Safari or Firefox. You can block website access to Facebook, YouTube or Twitter that can restrict access all together. This method doesn’t require you to download any software or install anything that you don’t want to have on your computer. The guide below is free and easy to complete to block a website on your computer and is great for blocking websites for all ages on content that you don’t want to access online.
With this method you can block websites on Mac and block a website when using the Internet by making a few additions in Terminal. You can also check out the Apple Support Page for more help and guides that great reads.
How to block a website on a Mac:
- Launch “Terminal” by going in /Applications/Utilities.
- When prompted, in the command line, type in
"sudo nano /etc/hosts"
. - It will then ask for your admin password, type your admin password.
- Next you’ll see in the screen the host database for your computer.
- Use the down arrow to go to the bottom and below under where it states,
"127.0.0.1 localhost"
. - Type in
"127.0.0.1 facebook.com"
. - On the next line type
"127.0.0.1 www.facebook.com"
; just to be safe it’s working correctly. - Next, hold down Control + “O”, which will save the changes to the host database.
- Press the “Return” key and then followed by Control + “X” to exit the current screen on your Mac.
- You can remove the past cache on your Mac by typing in
"sudo dscacheutil -flushcache"
in the command line, this refreshes the existing cache on the host database. - Test to make sure it works by going to Facebook.com, when you go to the site a message saying, “Unable to connect” error message will show up and blocking you from going to the Facebook site.