How to Block and Unblock Websites on Mac
Enable Parental Controls
Open System Preferences. Click the apple icon in the menu at the top of the screen and select System Preferences. You can find it in the Applications folder or on the Dock (System Tray).
Select Parental Controls. On most versions of OS X, this option has a yellow icon. If you don't see the icon, you can type "Parental Controls" into the search bar in the top right corner of the System Preferences window. The corresponding icon will be highlighted.
Select the child's account. In the left panel, click on the user account you want to block or unblock the website, then click "Enable Parental Controls". You cannot activate with an administrator account.
If your child doesn't have an account, select "create a new account with parental controls" and follow the on-screen instructions.
If you cannot select a user, click on the lock icon in the corner of the screen and enter the administrator password.
Open the Web tab. This tab is at the top of the window. Some older versions of Mac OS X will replace it with a "Content" tab.
Access options to block websites. There are 2 ways to manage children's internet access:
Selecting "Try to limit access to adult websites automatically" will block adult websites from Apple's default list. You can add or remove websites from this list using the Customize button.
"Allow access to only these websites" will block all websites except the websites in the list. Add or remove websites using the + and - buttons.
See additional restrictions. To block access to adult content on the app, click on the App tab and adjust the settings as desired. To limit access on your computer during certain times, access the Time Limits tab.
Block websites. To unblock all websites, select "Allow unrestricted access to websites". This option does not disable parental control settings on other tabs (e.g. Apps and People).
Block websites with hosts file
Open the Terminal application. Open Applications > Utilities > Terminal. The application allows you to edit the hosts file - providing the IP address of the specific URL. By combining the fake IP address of a specific URL, you can prevent browsers from accessing that website.
This method is not 100% guaranteed and is not too difficult to overcome. But this is a quick way to set up a website on your personal computer so it doesn't affect your productivity. Although this is not the only way to block user access, you can combine it with other methods to achieve greater efficiency.
Backup hosts file. If a mistake is made when editing the hosts file, all internet access may be blocked. Creating a copy of the hosts file allows you to reuse the original if this is the case. With just one simple command:
In Terminal, enter the command sudo /bin/cp /etc/hosts /etc/hosts-originalexactly as it appears.
Press the Enter button on the keyboard to execute the command.
Enter the administrator password. Terminal will ask you to enter your password. Type the password and press Enter. The mouse pointer will not change position when you enter a password.
Open the hosts file. Enter the command below and press Enter: sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts. This command will open your Mac's hosts file in TextEdit mode in Terminal.
Additionally, you can edit the hosts file in the Terminal window with the command sudo nano -e /etc/hosts.
Skip existing text. The hosts file already has several IP addresses associated with "localhosts". Do not edit or delete this text or the browser will not function. Hover over the new line at the end of the text.
If you use the main Terminal window, use the arrow keys to move to the last line of the page.
Some users have reported an error where you can only add a new line above existing text in the hosts file.
Type 127 .0.0.1 . This is the internal IP address. If the web browser goes directly to this address, it cannot access the website.
Press the spacebar, then type the URL you want to block. Do not type "http://." For example, if you want to block access to Facebook, enter "127.0.0.1 www.facebook.com."
The hosts file only checks that the URL you enter is correct . For example, "google.com" only blocks the Google home page. You can still visit google.com/maps, google.com/mail, etc
Do not copy-paste from another document as there may exist some invisible characters that prevent the text from working.
Add the URL in a new line. Press Enter and start a new line with 127.0.0.1. Add it after the URL you want to block. You can block any website, but you must write a new line with 127.0.0.1.
In theory, you can add multiple URLs to one line (enter the IP address once), up to 255 characters. However, this method does not work on all versions of Mac OS X.
Turn off and save the hosts file. Close or exit the TextEdit dialog box when finished, then confirm you want to save the TextEdit file when asked. (In some cases, the file will be saved automatically.)
If editing in the main Terminal window, press ctrl+O to save, then press ctrl+X to close the file.
Clear cache. Type the command dscacheutil -flushcacheinto Terminal and press Enter. This command clears the cache so the web browser will check for updates to the hosts file immediately. The listed website will be blocked on all browsers.
You can restart your computer instead of clearing the cache. In many cases, the website will be blocked without needing to perform these operations.
Fix problem. If you can still access the website, it is likely that your web browser is accessing another subdomain, or accessing via IPv6 or bypassing this website's hosts file. You can fix the first two problems by adding the following lines to the hosts file:
127.0.0.1 (URL) without "www"
127.0.0.1 m.(URL) will block the mobile version of that website.
127.0.0.1 login.(URL) or apps.(URL) are some common variations of the home page. Visit the website and check the address for accuracy.
fe80::1%lo0 (URL) blocks access to the web over IPv6. Most websites do not automatically connect via IPv6, but Facebook is an exception.
If the above methods do not work, perhaps the hosts file is not working. Try another method of blocking websites.
Delete text to unblock websites. Open the hosts file and delete the line containing the URL you want to unblock. Save, exit, and clear cache according to the instructions in the step above to apply the changes.
To undo changes and restore from backup, press the key sudo nano /etc/hosts-originalin Terminal. Press ctrl+O, delete "-original" in the name, confirm and save.
Use another method
Install web browser extensions. Chrome, Firefox, and most modern browsers allow you to install extensions (or "add-ons") to adjust your browser's settings. Search for "block websites" or "filter websites" or "productivity" in your browser's utility store to find website blocking applications. Install the application, restart the browser then open the application settings, add the website you want to block.
Be cautious with apps that have low ratings or few reviews. Untrusted utilities can install malware on your computer.
This method only blocks websites on installed browsers.
Adjust router settings . Blocking a website from your router will prevent devices using the wireless network from accessing that website. Here's how to install:
Go to System Preferences → Network → WiFi → Advanced → TCP/IP tab.
Copy the IP address listed under "Router" and paste it into your browser's address bar. You will be taken to the router's settings page.
Enter username and password to log in to the router. If you've never changed the settings, find the default password for your router by product line. (Usually the username is "admin" and the password is "password")
Go to your router settings and find the option to block websites. Each manufacturer has a different way of arranging the menu, but you can find it in the "Access" or "Content" categories.
You should read it
- How to Block and Unblock Users on Instagram
- How to Unblock Websites
- How to Block and Unblock Internet Sites (On a Mac)
- How to block/unblock users on Discord
- How to block and unblock users on Instagram
- 6 simple ways to enable the right-click feature to block that site
- How to Block Websites on Mac
- How to block websites on Firefox
- How to Block Websites on Google Chrome
- How to block and unblock users on Facebook
- How to unblock default ads on Chrome
- How to unblock messages in Facebook Messenger
Maybe you are interested
How to open the hosts file on Windows - The hosts file stores the device's IP information
How to open the Host file on Windows 10, edit the hosts file
Phasmophobia: Strengths, Weaknesses and How to Collect Evidence of All Ghosts
Instructions to restore the hosts file on Windows to default
How to open the hosts file with Admin rights - Apply to open the file system
The best app to scare ghosts, trolls friends