How to block websites on Mac devices using different methods

Android and IOS

This article is all about how to block websites on Mac devices using different methods. In today’s modern world all of us use Facebook, WhatsApp, Instagram, Skype, hike and many of other social platforms on daily basis. But these are really helpful when they are used in a limit. Otherwise, these are nothing more than wastage of time. To increase your productivity it is important to block these websites on your system no matter you use Windows and Mac. To block websites on your Mac devices use these simple methods and increase your productivity on the internet rather than wasting your time on the internet. So use these methods on your Mac devices to block and unblock websites on your system.

Also Read: How to create keyboard shortcuts in Mac devices

Method 1: – How to block website on Mac by using Terminal

1.  First of all open terminal on your Mac devices. From here you can make changes in administrative to your Mac. The terminal will be a black icon on white text window. Terminal allows you to work with code on your computer. You can use the search bar to find the terminal on Mac otherwise, you can find it in /Application/Utilities.

2.  Now, you will type sudo nano/etc/hosts in the command line. After that, it will ask you for admin password now type admin password in it to proceed.

3.  After that a hosts file will be displayed on your screen now you should make a copy of your current hosts file to prevent you from any type of error. In case you make a mistake in hosts file then recover it from that copied host file so do it carefully.

4.  After that, now you will be able to open your host file. This is the file that you actually needs to adjust in order to block websites. After opening hosts file on your screen reach the bottom of the file and then press enter to create a new line in that host’s file.

5.  Now, here in this new line start it with the phrase “”. This line will tell your computer to block the site following it. after writing out these numbers in your host’s file press spacebar once to proceed.

6.  After that, now add the website which you want to block the number. For example, I want to block facebook on my system then type “”.remember that do not add the “http://” in it.

7.  After that, for the extra measure and in other words we can say that for extra security, type “” in a new line.

8.  After that, if you want to add any additional sites then press enter and add, a space and the website name in the new lines in an above-given manner. This will block the sites completely from your computer on any browser.

best ways to block a website on mac devices

9.  After that, to save the file press “ctrl+o” keys simultaneously. This will save the changes to the host database.

10. After that, click on the return key and then press “ctrl+X” key simultaneously from your keyboard to exit the screen.

11.  After that, you want to reset the cache to put your changes into effect. For resetting the cache type given below command in your terminal and then press enter to proceed. This will flush the cache allows your changes to take place in the host database.

sudo dscacheutil -flushcache

12. Now you can verify the blocked website by opening it in your browser. On the opening blocked website in the browser, like then it will show an “Unable to connect” error message on your screen.

If this method does not work on your system then use the second method for block websites on Mac devices in a simple way.

Method 2: – How to block website on mac using Parental controls

1.  First of all, click on the apple icon on the top menu and then click on the “System Preferences” to open system preferences on your screen. you can also find system preference in your application folder and typically on your Dock.

2.  After that, click on the “Parental Controls” icon from system preferences. if you don’t see the parental control icon then search it using search bar that is placed in the top right corner of the system preference window.

3.  After that, select a user account from your system for whom you want to block or unblock websites. This cannot be an administrator account. If you don’t have a user account other than administrator account then create a new account with parental control and follow the onscreen prompts.

4.  After selecting a user account, click on the “Enable parental controls” option for that account.

5.  After that open the web tab from your parental controls window. This tab is located near the top of the window. Some older versions of Mac os x have a “content” tab instead of the “web” tab.

6.  There are two options in the web tab to manage your child’s access to the internet that is given below.

 • Click on the “Try to limit access to adult websites automatically” this block adult websites according to Apple’s default list. You can also add and remove websites to this list by simply click on customize option.

 • Choose “Allow access to only these websites” option to block websites. In this list, you can add and remove websites according to your need by using the + and – buttons on your screen.

7.  You can also set time limits to your child account to consider additional restrictions. To limit access to the computer to certain hours, visit the time limits tab and set time according to your need.

8.  To unblock all websites on your Mac then choose “Allow unrestricted access to websites”. This will not disable parental control setting in other tabs.


These are the best and easiest method ever to block websites on your Mac devices. If you have any queries regarding this then feel free to ask through the comment section and also provide feedback to us because your feedback is valuable for us.

Your thoughts?

This site uses Akismet to reduce spam. Learn how your comment data is processed.