How to Block Websites on Mac

In this article, TipsMake will show you how to block a website on your Mac. Although there is no built-in way on Mac to block access to certain websites, you can adjust the host file, or the file that stores the server's IP information and the domains it points to, to block certain sites or Download the SelfControl app to block them for a predetermined time. In addition, you can also use the parental control feature on Mac to block access for other accounts.

Use host files

Picture 1 of How to Block Websites on Mac

Open Spotlight. Click the magnifying glass icon in the upper right corner of the screen. A search bar will appear in the middle of the screen.

Picture 2 of How to Block Websites on Mac

Type terminalin Spotlight to find the Terminal app on Mac.

Picture 3 of How to Block Websites on Mac

Click Terminal. It's the first result that appears under the Spotlight search bar. The Terminal application will open.

Picture 4 of How to Block Websites on Mac

Enter the host file command. Type sudo nano /etc/hostsinto Terminal, then press ⏎ Return. The host file, the file that controls access to your websites, will be opened.

Picture 5 of How to Block Websites on Mac

Enter your admin password. Now, enter the password you used to log into your Mac into Terminal and click ⏎ Returnto confirm your identity and open the host file.

When typing, the characters contained in the password are not displayed. Therefore, you will not be able to see them on Terminal.

It may take a while to open the host file.

Picture 6 of How to Block Websites on Mac

Create a new line in the hosts file. Scroll to the bottom of the file using the arrow keys and press ⏎ Return.

Picture 7 of How to Block Websites on Mac

Type 127.0.0.1then tap Tab ↹to leave some space between 127.0.0.1and the next part of the text.

Picture 8 of How to Block Websites on Mac

Enter the website address. That's the web address of the site you want to block. Don't forget to include the "www" and ".com" suffix when typing.

For example, to block Google, you would type: 127.0.0.1 www.google.com.

If you plan to block multiple websites, each URL must be on its own line.

Picture 9 of How to Block Websites on Mac

Save and exit the editor. Once you have entered all the pages you want to block, save by pressing Control+ Othen ⏎ Return. To exit the host file, simply click on the red circle in the upper left corner of the window.

Picture 10 of How to Block Websites on Mac

Clear your Mac's DNS memory . You can do so by typing sudo killall -HUP mDNSResponder;say DNS cache has been flushedand pressing ⏎ Return. Essentially, clearing DNS will refresh your browser's memory, preventing you from accessing sites that were blocked through saved settings or similar.

Use the SelfControl app

Picture 11 of How to Block Websites on Mac

Go to the SelfControl page at https://selfcontrolapp.com/ . SelfControl allows you to block specific sites for up to 24 hours, helping to improve your productivity. Once blocked, until the time limit expires, no way can help you access that page.

This is what makes SelfControl really effective, but at the same time, this also means you'll have to be careful about blocking sites.

Picture 12 of How to Block Websites on Mac

Click the blue Download SelfControl button in the middle of the page.

Picture 13 of How to Block Websites on Mac

Install SelfControl. This step usually involves opening the SelfControl folder and dragging the DMG file into the "Applications" folder shortcut. First, though, you'll have to confirm the download on MacOS Sierra.

Picture 14 of How to Block Websites on Mac

Open SelfControl. Click Spotlight , type selfcontrol, and click SelfControl just below the search bar.

Picture 15 of How to Block Websites on Mac

Click Edit Blacklist . It's located in the lower right corner of the SelfControl window.

Picture 16 of How to Block Websites on Mac

Click the + option in the lower left corner of the window.

Picture 17 of How to Block Websites on Mac

Enter your website address. Don't forget to add the "www" prefix.

For example, you would type www.youtube.comto block YouTube.

Picture 18 of How to Block Websites on Mac

Press ⏎ Return. Your website will be added to the blocked list.

Picture 19 of How to Block Websites on Mac

Set block time. Click and drag the slider to the right to increase the page block time. Drag the slider to the left to reduce this time.

Picture 20 of How to Block Websites on Mac

Press Start when you're ready to block. This button is at the top of the window. At this point, your website will be blocked for the specified period of time.

Use parental controls

Picture 21 of How to Block Websites on Mac

Open Apple Menu. Click the Apple logo in the upper left corner of the screen to drop this menu.

This method only blocks websites on Safari.

Through parental controls, you cannot apply this website block to your own account, but can only apply it to another account.

Picture 22 of How to Block Websites on Mac

Click System Preferences in the drop-down menu.

Picture 23 of How to Block Websites on Mac

Tap Parental Controls . This option is located in the System Preferences window.

Picture 24 of How to Block Websites on Mac

Click the clock icon in the lower left corner of the screen.

Picture 25 of How to Block Websites on Mac

Enter your username and password. At this point, the menu will be unlocked and you can make changes to the parental management settings.

To do this, you must log into an administrator account.

Picture 26 of How to Block Websites on Mac

Select user. Click on a user's account name in the left pane to select that account.

You cannot choose your own account.

If no users are listed, select "Create a new user account with Parental Controls" and press Continue .

Picture 27 of How to Block Websites on Mac

Click the Web tab at the top of the window.

Picture 28 of How to Block Websites on Mac

Check the "Try to limit access to adult websites" box near the top of the window.

Picture 29 of How to Block Websites on Mac

Click the Customize option below the text "Try to limit access to adult websites". A new menu will appear.

Picture 30 of How to Block Websites on Mac

Click the + sign under the "Never allow these websites" heading. A text box will open.

Picture 31 of How to Block Websites on Mac

Type in the website address. That is the address of the page you want to block.

For example, to block Twitter, you would type www.twitter.com.

Picture 32 of How to Block Websites on Mac

Click ⏎ Returnto enter the address. At this time, the page you just entered has been blocked on the Safari browser of the selected accounts.

Update 26 June 2024
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile