How to block and unblock internet sites (on Mac)

Table of contents:

How to block and unblock internet sites (on Mac)
How to block and unblock internet sites (on Mac)
Anonim

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

Block and Unblock Internet Sites (On a Mac) Step 13
Block and Unblock Internet Sites (On a Mac) Step 13

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.

Block and Unblock Internet Sites (On a Mac) Step 14
Block and Unblock Internet Sites (On a Mac) Step 14

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.

Block and Unblock Internet Sites (On a Mac) Step 15
Block and Unblock Internet Sites (On a Mac) Step 15

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.
Block and Unblock Internet Sites (On a Mac) Step 16
Block and Unblock Internet Sites (On a Mac) Step 16

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.

Block and Unblock Internet Sites (On a Mac) Step 17
Block and Unblock Internet Sites (On a Mac) Step 17

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.
Block and Unblock Internet Sites (On a Mac) Step 18
Block and Unblock Internet Sites (On a Mac) Step 18

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.

Block and Unblock Internet Sites (On a Mac) Step 19
Block and Unblock Internet Sites (On a Mac) Step 19

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

Block and Unblock Internet Sites (On a Mac) Step 1
Block and Unblock Internet Sites (On a Mac) Step 1

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

Block and Unblock Internet Sites (On a Mac) Step 2
Block and Unblock Internet Sites (On a Mac) Step 2

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.
Block and Unblock Internet Sites (On a Mac) Step 3
Block and Unblock Internet Sites (On a Mac) Step 3

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.

Block and Unblock Internet Sites (On a Mac) Step 4
Block and Unblock Internet Sites (On a Mac) Step 4

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

Block and Unblock Internet Sites (On a Mac) Step 5
Block and Unblock Internet Sites (On a Mac) Step 5

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.
Block and Unblock Internet Sites (On a Mac) Step 6
Block and Unblock Internet Sites (On a Mac) Step 6

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.

Block and Unblock Internet Sites (On a Mac) Step 7
Block and Unblock Internet Sites (On a Mac) Step 7

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

  • Please note that only the entered address is blocked. For example, if you entered www.google.com, the home page of the Google site will be blocked; in this case, you will be able to open google.com/maps, google.com/mail and similar pages.
  • Do not copy the site address or paste it into the hosts file. This can introduce invisible characters that prevent the file from working properly.
Block and Unblock Internet Sites (On a Mac) Step 8
Block and Unblock Internet Sites (On a Mac) Step 8

Step 8. Enter the address of each blocked site on a new line

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.

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 …

Block and Unblock Internet Sites (On a Mac) Step 9
Block and Unblock Internet Sites (On a Mac) Step 9

Step 9. Save and close the hosts file

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).

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

Block and Unblock Internet Sites (On a Mac) Step 10
Block and Unblock Internet Sites (On a Mac) Step 10

Step 10. Clear the cache

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.

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

Block and Unblock Internet Sites (On a Mac) Step 11
Block and Unblock Internet Sites (On a Mac) Step 11

Step 11. Troubleshooting

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:

  • 127.0.0.1 site_address (without www)
  • 127.0.0.1 m.site_address (blocks the mobile version of the site)
  • 127.0.0.1 login.site_address or apps.site_address (these are common variations of site home page addresses; open a site and check its home page address).
  • fe80:: 1% lo0 site_address is blocking access to sites over IPv6. Most sites are not accessed via IPv6, but Facebook is an exception here.
  • If none of the described options worked, then, most likely, this is not the case in the hosts file. In this case, use another method of blocking sites.
Block and Unblock Internet Sites (On a Mac) Step 12
Block and Unblock Internet Sites (On a Mac) Step 12

Step 12. Remove the appropriate line to access a specific site

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).

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

Block and Unblock Internet Sites (On a Mac) Step 20
Block and Unblock Internet Sites (On a Mac) Step 20

Step 1. Install the browser extension

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.

  • Don't download extensions with low ratings or few reviews. Such extensions may contain malicious code.
  • The extension blocks the specified sites only in the browser in which it is installed.
Block and Unblock Internet Sites (On a Mac) Step 21
Block and Unblock Internet Sites (On a Mac) Step 21

Step 2. Configure the parameters of the router

This will block the specified sites on any device that is connected to the wireless network. Here's how to set up your router:

  • Click "System Preferences" - "Network" - "WiFi" - "Advanced" - "TCP / IP".
  • Copy the IP address shown in the "Router" line and paste it into the address bar of your browser. The login page for the router settings will open.
  • Enter your username and password to enter the router settings. If you do not know the default username and password, search the Internet for your router model. Typically, you enter admin for the username and password for the password.
  • Review your router settings and look for an option to configure site blocking. The options depend on the router model, but in most cases look for the corresponding option in the Access or Content menu.

Popular by topic