Monday, July 4, 2022
- Advertisement -

How To Block Websites On Your Mac

In this article, we explain how to block websites on your Mac

In this article, we explain how to block websites on your Mac. Blocking certain websites can keep you productive during the workday, or minimize the chance of your child finding adult content. You can create a website “blacklist” for your Mac in several ways. While the built-in Parental Control options are the easiest to use, you will need to use the hosts file instead if you want to block sites on an administrator account.

How To Block Websites On Mac? Enabling Parental Controls

The best way to block websites on a Mac is to set up an account with parental controls that allow for customized content filtering or blocking.

  • Click the Apple logo at the top left corner of the screen and select “System Preferences” from the dropdown menu.
  • In the window that pops up, hit the “Parental Controls” icon (it’s a yellow circle with two stick figures inside it, in the bottom row).
  • Enter the computer’s password for access (note that you may need to hit the padlock icon in the bottom left corner of the screen).
  • Create a new account, entering a name and selecting the age of the user (go for 17+ if this is for a workplace or college).
  • Click the word “Web” from the taskbar at the top of the Parental Controls window.
  • To allow access only to specified sites, click the “Allow access to only these websites” option and enter the sites that will be permitted one by one; to block specific websites, click the “Try to limit access to adult websites” option, then hit the “Customize” button.
Source: William Antonelli/Business Insider
  • In the popup window, enter the names of sites that are always to be blocked, then hit “OK.”

Now just make sure your kid, students, or employees can only log into the account you just configured to limit access, or all that work was for nothing.

And remember that these settings will only apply to Apple’s own browser, Safari. If you want to block websites in Chrome, Firefox, or other browsers, you’ll need to download specific add-ons for those browsers.

Also read: Fix “Safari Can’t Open Page” Error on iPhone, iPad and Mac

Using Mac Terminal

  • Open the Terminal application. Open Applications, then Utilities, then Terminal. This application allows you to modify your hosts file, which provides IP addresses for certain URLs. By associating a false IP address with a certain URL, you can prevent your browsers from reaching it.
How To Block Websites On Your Mac
Source: LaptopMag
  • Back up your hosts file. If you make a mistake while editing the hosts file, you could block all access to the internet. Creating a backup copy allows you to return to the original version if this happens. This is as simple as a single command:

In Terminal, type sudo /bin/cp /etc/hosts /etc/hosts-original exactly as it appears.
Press Enter on your keyboard to execute the command.

  • Enter an administrator password. Terminal should prompt you for your password. Type it in and press Enter.
How To Block Websites On Your Mac – Source: LaptopMag
  • Open the hosts file. Enter the following command, then press Enter: sudo /Applications/ /etc/hosts. This command will open your Mac’s hosts file in TextEdit mode within Terminal.

Alternatively, you can edit the hosts file in the main Terminal window using the command sudo nano -e /etc/hosts.

How To Block Websites On Your Mac
Source: LaptopMag
  • Skip past the existing text. Your hosts file should already have several IP addresses linked to “localhosts.” Never edit or delete this text, or your web browsers may stop working. Place your cursor on a new line at the bottom of the document.

If you are using the main Terminal window, use the arrow keys to reach the bottom of the page.

How To Block Websites On Your Mac

A few users have reported a bug where adding new text to the hosts file only works if you add them above the existing text.

  • Type in “ ” followed by that address with the “www.” prefix in front of it. Do not include “http://.” For example, “”
How To Block Websites On Your Mac
How To Block Websites On Your Mac – Source: LaptopMag

If a web browser is directed to this address, it will fail to reach the web page.

How To Block Websites On Your Mac – Source: LaptopMag

The hosts file only checks for the exact URL you enter. For example, “” will only block the Google home page. You will still be able to access,, and so on.

Tip: Do not copy-paste from another document. This can introduce invisible characters that prevent the text from working.

  • Add more URLs on new lines. Press Enter and begin a new line with Follow it with another URL you want to block. You may block any number of websites, but you must start each new line with

Editor’s picks:

Diekola Yusuf
Diekola Yusuf
Founder & CEO of Novabach - Yusuf is a Tech enthusiast. Fascinated by Computers and all sorts of Technology. He writes news, updates, walkthroughs, guides, troubleshooting tips, and how-to tutorials on gadgets and consumer electronics.
- Advertisement -

Latest Posts

- Advertisement -

Editor's Picks

Related news