How to Block a Website Using the Terminal App on your MacBook Pro

One may need to block a website for various reasons. It may be trying to send you malware or unwanted notifications. Or if the PC is used by children then you can block certain adult content or ultra-violent media to ensure that they are not affected by it while casually scrolling through the internet. While no type of content can be blocked 100% you can always the primary websites and try to censor the usability of your PC.

If you are a MacBook Pro user then you can use the Terminal app to achieve this goal rather easily. Follow the steps below to learn how to use this feature:

Step 1
Open up the Terminal app from your list of applications or you can search it through the spotlight.

Step 2
In the Terminal window type in the following code: ‘sudo nano /etc/hosts’ and hit enter.

Step 3
After the code which auto-writes itself type in ‘’ hit space and then type in the name of the website you want to block. For Example ff you want to block Facebook, the code you type in will look like ''. Press 'Enter' when done.

Step 4
Press ‘Control +’ x followed by an ‘Y’. This will save the command onto your PC.

Step 5
If you wish to unblock it simply go back to the code and add an extra letter to the website name in the code. For example in this case make it ‘ facebook.com12’ and the blocking feature will be removed from the particular website.

Use this cool feature to block any un-necessary and vulgar content online and keep your PC clean and family friendly. Terminal is a great tool to use for MacBook Pro users and can provide ease of access regarding various functionalities.
Not open for further replies.
Not open for further replies.