How to Block Websites on Safari
You can block websites on Safari quite easily with the OS X operating system's built-in parental controls, which can be enabled by setting up individual accounts with different access privileges for members of your family. The parental controls, however, do not block other Web browsers, such as Firefox, from accessing websites on the Macintosh. A more thorough way to block websites from Safari and all browsers is to edit the hosts file in the Macintosh system and redirect blocked website addresses back to the local machine so the browser can't find them.
Instructions
-
Create a User Account with Parental Controls
-
1
Open the "System Preferences" utility in the Applications folder on OS X.
-
2
Click the "Accounts" icon in the System row.
-
-
3
Click the "Lock" icon at the bottom of the accounts window to enable adding a new account. Enter your administrator password when prompted.
-
4
Click the "+" sign in the lower left to add a new account.
-
5
Enter a name, short name, password, the password again, and a password hint. Do not check off the allow admin box or this user will have full access to the computer, including adding and deleting accounts.
-
6
Click "Create Account" and click the "Turn Off Automatic Login" button when prompted. This will force all users to log in every time the computer starts.
-
7
Click on the name of the new user in the list on the left side of the screen and click the "Parent Controls" tab at the top of the screen.
-
8
Click the check box next to Safari and click the "Configure" button to the right. The system will tell you to log in as the new user and open Safari to configure the sites the user is allowed to visit.
-
9
Return to "Finder" and select "Log Out" under the Apple menu. Log in as the new user.
-
10
Launch Safari and select "Preferences" and choose "Security" from the Safari menu.
-
11
Remove the check next to "Enable Parental Controls," enter your administrator password and close the preferences box.
-
12
Add bookmarks for all the allowed sites to the bookmarks bar and remove all other bookmarks.
-
13
Return to Safari, click "Preferences," choose "Security" and check off the box for "Enable Parental Controls" again. Enter your administrator password to secure your changes. Now only the sites you have bookmarked are accessible in this user account.
Edit Hosts File with the Terminal Utility
-
14
Click the "Finder," select "Applications," choose the "Utilities" folder and click "Terminal."
-
15
Type "cp /etc/hosts ~/Desktop/hosts.txt" (without the quotes) to copy your current hosts.txt file to the desktop as backup.
-
16
Type "sudo pico /etc/hosts".
-
17
Enter your Macintosh administrator password and press "Enter."
-
18
Use the arrow key to move the block cursor down to the bottom of the file and enter the IP address "127.0.0.1" followed by the domain name you want to block. This tells the computer that the address for that domain is now that IP number 127.0.0.1, which is your local Macintosh, and the browser won't be able to resolve that domain to a Web page.
-
19
Press "Ctrl-X" to exit after you have entered all the domains you wish to block. The domains need to be on separate lines. You will be prompted to save. Type "Y" for Yes.
-
20
Press "Enter" again to confirm the file you want to write to is /etc/hosts.
-
21
Click the Terminal menu and select Quit Terminal to exit.
-
22
Open Safari and type in the domains you blocked in the hosts file. All other browsers on your machine will be blocked from accessing that domain as well. You can enter as many domains as you want into the hosts file, but put each command on a new line and remember this action blocks them from all users of the computer, including you.
-
1
Tips & Warnings
You can enter" 0.0.0.0" for the IP address in the hosts file as well. It's equivalent to "127.0.0.1."
When using Mac OS X parent controls for Safari, test the websites you allow and make sure they are usable. Some sites redirect to other domains under their control. If that happens, you will need to allow the other domain for the site to be fully functional.
Mac OS X Parental Controls do not stop Web browsers other than Safari from accessing websites not on your approved list.
Protect your Macintosh administrator password. Technically savvy children can bypass your parental controls if they figure out your password.