How to Block and Unblock Internet Sites (On a Mac)

Method 1 of 3:

Enabling Parental Controls

  1. How to Block and Unblock Internet Sites (On a Mac) Picture 1
    Open System Preferences. Click the apple icon in the top menu and select System Preferences. You can also find this in your Applications folder, and typically on your Dock.
  2. How to Block and Unblock Internet Sites (On a Mac) Picture 2
    Select Parental Controls. On most versions of OS X this is a clearly labeled yellow icon. If you do not see it, type "Parental Controls" into the search bar in the top right corner of the System Preferences window. This will highlight the correct icon.
  3. How to Block and Unblock Internet Sites (On a Mac) Picture 3
    Select the child's account. On the left hand pane, click on the user account for whom you want to block or unblock websites, then click "Enable Parental Controls." This cannot be an administrator account.
    1. If your child does not have an account, select the option "create a new account with parental controls" and follow the onscreen prompts.
    2. If you cannot select the user, click the lock icon in the corner of the window and enter an administrator password.[1]
  4. How to Block and Unblock Internet Sites (On a Mac) Picture 4
    Open the Web tab. This is located near the top of the window. Some older versions of Mac OS X have a "Content" tab instead.
  5. How to Block and Unblock Internet Sites (On a Mac) Picture 5
    Browse through the options to block websites. There are two different ways to manage your child's access to the internet:
    1. Choosing "Try to limit access to adult websites automatically" will block adult websites using Apple's default list. You may add or remove websites to this list with the Customize button.
    2. "Allow access to only these websites" blocks all sites not specifically listed below this option. Add and remove sites using the + and - buttons.
  6. How to Block and Unblock Internet Sites (On a Mac) Picture 6
    Consider additional restrictions. To block access to adult content through apps, click the App tab and adjust settings as desired. To limit access to the computer to certain hours, visit the Time Limits tab.
  7. How to Block and Unblock Internet Sites (On a Mac) Picture 7
    Unblock websites. To unblock all websites, select "Allow unrestricted access to websites." This will not disable parental control settings in other tabs (such as Apps and People).
Method 2 of 3:

Blocking Sites with the Hosts File

  1. How to Block and Unblock Internet Sites (On a Mac) Picture 8
    Open the Terminal application. Open Applications, then Utilities, then Terminal. This application allows you to modify your hosts file, which provides IP addresses for certain URLs. By associating a false IP address with a certain URL, you can prevent your browsers from reaching it.
    1. This method does not have a 100% success rate, and is not too difficult to bypass. It's a quick way to block a website on your personal computer, for productivity reasons. While not recommended as the only way to block other users' access, you can try it alongside another method for greater effect.
  2. How to Block and Unblock Internet Sites (On a Mac) Picture 9
    Back up your hosts file. If you make a mistake while editing the hosts file, you could block all access to the internet. Creating a backup copy allows you to return to the original version if this happens. This is as simple as a single command:[2]
    1. In Terminal, type sudo /bin/cp /etc/hosts /etc/hosts-original exactly as it appears.
    2. Press Enter on your keyboard to execute the command.
  3. How to Block and Unblock Internet Sites (On a Mac) Picture 10
    Enter an administrator password. Terminal should prompt you for your password. Type it in and press Enter. The cursor will not move from its position as you type your password.
  4. How to Block and Unblock Internet Sites (On a Mac) Picture 11
    Open the hosts file. Enter the following command, then press Enter: sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts. This command will open your Mac's hosts file in TextEdit mode within Terminal.
    1. Alternatively, you can edit the hosts file in the main Terminal window using the command sudo nano -e /etc/hosts.
  5. How to Block and Unblock Internet Sites (On a Mac) Picture 12
    Skip past the existing text. Your hosts file should already have several IP addresses linked to "localhosts." Never edit or delete this text, or your web browsers may stop working. Place your cursor on a new line at the bottom of the document.
    1. If you are using the main Terminal window, use the arrow keys to reach the bottom of the page.
    2. A few users have reported a bug where adding new text to the hosts file only works if you add them above the existing text.[3]
  6. How to Block and Unblock Internet Sites (On a Mac) Picture 13
    Type 127.0.0.1. This is the local IP address. If a web browser is directed to this address, it will fail to reach the web page.
  7. How to Block and Unblock Internet Sites (On a Mac) Picture 14
    Hit the space bar, then type the URL you would like to block. Do not include "http://." For example, if you want to block access to Facebook, the line should read "127.0.0.1 www.facebook.com."
    1. The hosts file only checks for the exact URL you enter. For example, "google.com" will only block the Google home page. You will still be able to access google.com/maps, google.com/mail, and so on.
    2. Do not copy-paste from another document. This can introduce invisible characters that prevent the text from working.
  8. How to Block and Unblock Internet Sites (On a Mac) Picture 15
    Add more URLs on new lines. Press Enter and begin a new line with 127.0.0.1. Follow it with another URL you want to block. You may block any number of websites, but you must start each new line with 127.0.0.1.
    1. In theory you can include multiple URLs on one line (entering the IP address only once), up to a maximum of 255 characters.[4] However, this may not work on all versions of Mac OS X.[5]
  9. How to Block and Unblock Internet Sites (On a Mac) Picture 16
    Close and save the hosts file. Close or quit the TextEdit dialog box when you are done, then confirm that you want to save the TextEdit file when prompted. (In some cases the file may save automatically.)
    1. If editing in the main Terminal window, press ctrl+O to save, then ctrl+X to close the file.
  10. How to Block and Unblock Internet Sites (On a Mac) Picture 17
    Flush the cache. Type the command dscacheutil -flushcache into Terminal and press Enter. This will clear the cache so your browser is sure to check the updated hosts file immediately. The websites you listed should now be blocked on all browsers.
    1. You may restart your computer instead to get the same effect. In many cases, the sites will be blocked even without this step.
  11. How to Block and Unblock Internet Sites (On a Mac) Picture 18
    Troubleshoot. If you can still access one of the websites, your browser may be accessing a different subdomain, accessing the site via IPv6, or bypassing your hosts file for that site. You can solve the first two problems by adding more lines to your hosts file:
    1. 127.0.0.1 (URL) without the "www"
    2. 127.0.0.1 m.(URL) will usually block the mobile version of the site
    3. 127.0.0.1 login.(URL) or apps.(URL) are a couple common variations of home pages. Visit the website and check your address bar for the exact variation.
    4. fe80::1%lo0 (URL) blocks IPv6 access to the site. Most sites do not automatically connect you via IPv6, but Facebook is a notable exception.
    5. If none of these variations work, there is probably no hosts file workaround. Try one of the other block methods on this page.
  12. How to Block and Unblock Internet Sites (On a Mac) Picture 19
    Remove the entry to unblock the website. Open your hosts file again and delete the entry for the URL you would like to unblock. Save, quit, and flush the cache as described above to push through the change.
    1. To undo all changes and restore from your backup, enter sudo nano /etc/hosts-original in Terminal. Press ctrl+O, delete the "-original" in the name, and confirm the save.
Method 3 of 3:

Using Other Methods

  1. How to Block and Unblock Internet Sites (On a Mac) Picture 20
    Install a browser extension. Chrome, Firefox, and most other modern browsers allow you to install user-made extensions (or "add-ons") to adjust browser behavior. Search your browser's extension store for "block websites," "filter websites," or "productivity" to find apps that block websites. Install the app, restart your browser, then open the app settings and add the sites you would like to block.
    1. Be careful of apps with low ratings, or too few reviews to judge accurately. Untrustworthy extensions may install malware to your computer.
    2. This will only block websites on that browser.
  2. How to Block and Unblock Internet Sites (On a Mac) Picture 21
    Adjust your router settings. Blocking sites on your router will prevent any device using the wireless network from accessing those sites. Here's how to set this up:
    1. Go to System Preferences → Network → WiFi → Advanced → TCP/IP tab.
    2. Copy the IP address listed after "Router" and paste it into your browser's address bar. This should take you to your router settings.
    3. Enter the username and password to log in to your router. If you have never set these, look up the default password for that router model. (User "admin" and password "password" are common defaults.)
    4. Browse the router settings for site blocking options. Each router brand has a different set of options, but most allow you to block sites in an "Access" or "Content" menu.
4.5 ★ | 2 Vote

May be interested

  • How to unblock callers on FaceTimeHow to unblock callers on FaceTime
    if you've blocked someone from calling you on facetime and changed your mind, follow the steps in this article to unblock them.
  • How to block someone on Snapchat?How to block someone on Snapchat?
    someone annoys you, annoys you on snapchat, how can you block them? this article will guide you how to block someone on this social networking application.
  • Block web browser with IPSecBlock web browser with IPSec
    this tutorial will explain how to block browsing of certain computers to the internet but still have access to sites on the intranet.
  • Instructions to block Threads accountInstructions to block Threads account
    threads also sometimes annoys you by advertising threads accounts, spam threads accounts. if so we should block the threads account.
  • How to Block Users on FacebookHow to Block Users on Facebook
    this article explains how to block users on facebook so they cannot find, view, or contact your account. you can do this on the phone app and the computer website. if you accidentally block someone, you can always unblock them.
  • How to Successfully Access Facebook in ChinaHow to Successfully Access Facebook in China
    one of the major problems travelers face when visiting china is the chinese government's restrictions on access to the internet. specifically, popular social sites such as facebook, twitter and youtube will be blocked by the government's firewall, just as other news sites will be blocked. if you want to share travel experiences with your friends and family, follow the instructions below to unblock and access the websites you want.
  • How to block or unblock programs on Windows Firewall?How to block or unblock programs on Windows Firewall?
    there are many ways to block a program on windows operating systems, but perhaps the most effective way to block an application or program on windows is to use windows firewall.
  • How to Block Websites on MacHow 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.
  • How to Unblock WebsitesHow to Unblock Websites
    blocked websites can make it difficult to stay connected with friends and family. many people around the world have to regularly face censorship filters imposed by governments or internet service providers. you may even have difficulty surfing the web at school or work. some restrictions even prevent users from using popular websites like youtube and facebook. luckily, there are still 3 ways to bypass these filters and unblock websites. surely you will be able to apply it even if you are not really tech-savvy.
  • How to Block a Website on MacHow to Block a Website on Mac
    this wikihow teaches you how to block a website on a mac. while there isn't a built-in way to block your own access to a certain website, you can download an app called selfcontrol or cold turkey to block sites for a set amount of time....