Blocking certain sites will increase your productivity or minimize the chances of your child opening an adult site. On Mac OS, you can create a blacklist of sites in several ways. The Parental Control feature is the easiest to use, but if you want to block sites as an administrator, you will have to use the hosts file.
Steps
Method 1 of 3: Enabling Parental Controls

Step 1. Open System Preferences
On the menu bar (top), click the apple button (Apple logo) and select the System Preferences option. You can also find this option in the Applications folder or in the Dock.

Step 2. Click on Parental Controls
Most versions of OS X have a yellow icon for this feature. If you don't see this icon, enter "Parental Controls" in the search bar (in the upper right corner of the window). This will highlight the corresponding icon.

Step 3. Highlight your child's account
In the left pane, click on the user account you want to block or allow access to certain sites, and then click Turn On Parental Controls. Be aware that this will not work with an administrator account.
- If your child does not have an account, click "Create a new account using parental controls" and follow the onscreen instructions.
- If you are unable to highlight a specific account, click the padlock icon (in the corner of the window) and enter your administrator password.

Step 4. Go to the "Network" tab
It is located at the top of the window. In some older versions of Mac OS X, this tab is called Content.

Step 5. Review the available options for blocking sites
There are two ways to control your child's internet access:
- Select the "Automatically restrict access to adult sites" option to block adult sites based on Apple's default list. You can edit (add or remove sites) this list using the Customize button.
- Select the "Allow access to specific sites only" option to block all sites that are not listed in the list below the option. You can edit (add or remove sites) this list using the + and - buttons.

Step 6. Introduction of additional restrictions
To block access to adult sites through apps, go to the Apps tab and adjust the settings according to your preferences. To restrict access to your computer at a specific time, go to the "Time Limit" tab.

Step 7. Unblock access to sites
To unblock access to all sites, select the "Allow unlimited access to sites" option. This will not disable or change the settings for Parental Controls on other tabs, such as Applications and Users.
Method 2 of 3: Blocking Websites Using the Hosts File

Step 1. Open a terminal
To do this, open the Applications folder, and then open the Utilities folder and click on Terminal. In the terminal, you can modify the hosts file, which contains a list of IP addresses of the respective sites. By specifying a false IP address for a specific site, you will block access to this site (the browser simply will not be able to open it).
This method does not guarantee 100% reliability of site blocking; moreover, such blocking is rather easy to bypass. This is a quick way to block a specific site so that the content on that site does not distract you from your work. It is not recommended to use this method as the only method of blocking sites - to achieve greater effect, use another method of blocking sites

Step 2. Make a backup copy of the hosts file
If you make a mistake while editing the hosts file, this can lead to a complete blocking of Internet access. So back up your hosts file in case something goes wrong. The file is backed up with one command:
- In a terminal, enter sudo / bin / cp / etc / hosts / etc / hosts-original.
- Press the Enter key to execute the command.

Step 3. Enter the administrator password
The terminal will ask you to enter the administrator password. Do this and press Enter. Note that the cursor will not move when entering the password.

Step 4. Open the hosts file
Type the following command and then press Enter: sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit / etc / hosts. The Mac OS hosts file opens in TextEdit.
Alternatively, you can edit the hosts file directly in the terminal window with the command sudo nano -e / etc / hosts

Step 5. Ignore the existing contents of the hosts file
Any hosts file contains a list of IP addresses associated with local hosts. Do not edit or delete this list; otherwise, your browser may stop working. Place the cursor on a new line at the bottom of the open file.
- If you are editing a file in a terminal window, use the arrow keys to position the cursor on a new line at the bottom of the open file.
- Some users run into problems adding new IP addresses at the very beginning of the hosts file.

Step 6. Enter 127.0.0.1
This is the local IP address. If you direct your browser to this address, it will not be able to open the site.
7 Press the spacebar and enter the URL of the site you want to block. You do not need to enter the http:// prefix. For example, if you want to block access to Facebook, the line you entered should look like this: 127.0.0.1 www.facebook.com Press Enter, on a new line, enter 127.0.0.1, and then continue this line with the address of the site you want to block. You can block any number of sites, but each new line must start with 127.0.0.1. Close the TextEdit window, and then, when prompted, confirm that you want to save the hosts file (in some cases, the file will be saved automatically). In a terminal, enter the dscacheutil -flushcache command and press Enter. This will clear the cache, allowing the browser to immediately start working with the updated hosts file. Now the sites you specified will be blocked in all browsers. If one of the sites you specified is not being blocked, your browser opens it through a different subdomain or over IPv6, or by ignoring the hosts file for that site. The first two problems are solved by entering the following lines into the hosts file: Open the hosts file and remove the line with the site address you want to unblock. Save and close the hosts file, and then clear the cache (read about this above). In Chrome, Firefox and most other modern browsers, you can install extensions (add-ons) made by other users that increase the functionality of the browser. Go to the site where the extensions for your browser are stored and enter “site blocking” (or something similar) in the search bar to find the site blocking extension. Install the extension, restart your browser, open the extension's settings and add the sites you want to block. This will block the specified sites on any device that is connected to the wireless network. Here's how to set up your router:
Step 8. Enter the address of each blocked site on a new line
Theoretically, you can enter several site addresses on one line at once (in this case, the IP address is entered only once), but the number of characters on one line should not exceed 255. However, this method may not work in a particular version of Mac OS X …
Step 9. Save and close the hosts file
If you are editing the hosts file in a terminal window, press ctrl + O to save the file, and then press ctrl + X to close the file
Step 10. Clear the cache
To get the same effect, just restart your computer. In most cases, these sites will be blocked even if you do not complete this step
Step 11. Troubleshooting
Step 12. Remove the appropriate line to access a specific site
To undo any changes you made and restore the hosts file from a backup, enter sudo nano / etc / hosts-original in a terminal. Press ctrl + O, delete "-original" in the file name and confirm your actions
Method 3 of 3: Other Methods
Step 1. Install the browser extension
Step 2. Configure the parameters of the router