How to Block Websites on Mac (2026)
Whether you want to protect your kids from harmful content, block distractions during work, or strengthen your network security, macOS gives you several ways to restrict website access. Some are built right in, others require a quick trip to Terminal.
This guide covers five proven methods, from the simplest click-and-block approach to more advanced techniques that work across every browser on your Mac.
Quick Comparison: Which Method Should You Choose?
| Method | Difficulty | All Browsers | Bypass Risk | Best For |
|---|---|---|---|---|
| Screen Time | Easy | Safari only | Medium | Parents |
| Hosts File | Moderate | Yes | Low | Tech users |
| DNS Filtering | Moderate | Yes | Very Low | Businesses |
| Router Settings | Moderate | Yes | Low | Households |
| Third-Party Apps | Easy | Yes | Medium | Productivity |
Method 1: Use Screen Time (Easiest)
Screen Time is the fastest way to block websites on a Mac. It comes pre-installed on macOS Catalina (10.15) and later, so there’s nothing to download. The catch? It mainly affects Safari and may not block sites in Chrome or Firefox.
How to Set It Up
Step 1: Open System Settings — Click the Apple menu in the top-left corner, then select System Settings.
Step 2: Go to Screen Time — Click Screen Time in the sidebar. Make sure it’s turned on.
Step 3: Open Content & Privacy — Click Content & Privacy, then toggle on Content & Privacy Restrictions.
Step 4: Restrict Web Content — Under Web Content, choose Limit Adult Websites. Then click Customize.
Step 5: Add Sites to Block — In the Restricted section, click the + button and type the URL you want to block (e.g., facebook.com). Click Done.
Pro Tip: For a stricter approach, choose Allowed Websites Only instead. This blocks everything except the sites you manually approve — ideal for a child’s Mac.
Limitations of Screen Time
Screen Time is easy to set up, but it has real drawbacks. It primarily filters Safari, so tech-savvy users can bypass it by switching to another browser. There’s no central management for multiple devices, and the adult content filter is a broad category — you can’t fine-tune it to block gaming or social media specifically.
Method 2: Edit the Hosts File (Works in Every Browser)
Your Mac has a hidden file called the hosts file. Think of it as a phone book for the internet: when you type a website address, your Mac checks this file first. By adding a fake entry that points a website to nowhere, your Mac won’t be able to load it — in any browser, in any app, no exceptions.
This method is more technical than Screen Time, but it’s also far more effective. You’ll need to open Terminal, the built-in command-line tool on every Mac. Don’t worry — you only need to copy and paste a few lines.
Step-by-Step Instructions
Step 1: Open Terminal. Press Command + Space to open Spotlight, type Terminal, and hit Enter. A window with a blinking cursor will appear — that’s where you’ll paste the commands below.
Step 2: Create a safety backup. Before changing anything, save a copy of the original file. Copy and paste this line into Terminal, then press Enter:
sudo /bin/cp /etc/hosts /etc/hosts-original
Your Mac will ask for your password. Type it (nothing will appear on screen — that’s normal) and press Enter.
Step 3: Open the hosts file for editing. Copy and paste this line and press Enter:
sudo nano /etc/hosts
A simple text editor will open inside Terminal.
Step 4: Add the websites you want to block. Use the arrow keys to move your cursor to the very bottom of the file. Then, on a new line, type the following (replace facebook.com with whatever site you want to block):
127.0.0.1 facebook.com
127.0.0.1 www.facebook.com
You can add as many sites as you want, one per line. The number 127.0.0.1 tells your Mac to redirect the website to itself — which means the page simply won’t load.
Step 5: Save and close. Press Control + O (the letter O, not zero), then Enter to save. Then press Control + X to exit the editor.
Step 6: Apply the changes. Paste this final command and press Enter:
sudo dscacheutil -flushcache
This clears your Mac’s memory so the new rules take effect immediately. Open any browser and try visiting the site — it should fail to load.
If something goes wrong, you can restore the original file at any time. Open Terminal and run:
sudo /bin/cp /etc/hosts-original /etc/hosts— this will undo all your changes and bring everything back to normal.
Why This Method Is Worth the Effort
Unlike Screen Time, the hosts file blocks websites in every browser and every app on your Mac. There’s no extension to disable, no toggle to flip. It’s built into macOS itself, and a standard user without admin access can’t undo it. The tradeoff: you need to add sites one by one (no category-based blocking), and you have to be comfortable copying commands into Terminal.
Method 3: Set Up DNS Filtering
Every time you visit a website, your Mac asks a DNS server (like a phone book for the internet) to translate the address into a number your computer can understand. By switching to a DNS server that refuses to translate certain websites, those sites simply stop working — on every browser, every app, without installing anything.
Services like OpenDNS, CleanBrowsing, or NextDNS let you block entire categories of websites (adult content, gambling, social media) from a simple online dashboard.
How to Configure It on Mac
Step 1: Open System Settings. Click the Apple menu > System Settings > Network. Click on your active connection (usually Wi-Fi), then click Details, then go to the DNS tab.
Step 2: Replace the DNS servers. Click the - button to remove existing entries. Then click + and add the IP addresses from your chosen provider. For example, to use OpenDNS Family Shield (blocks adult content automatically), add these two addresses:
208.67.222.123208.67.220.123
Click OK, then Apply.
Step 3: Test it. Open any browser and visit a site that should be blocked. If the setup worked, you’ll see a block page instead of the website.
Why DNS Filtering Stands Out
DNS filtering is the most scalable option. You can block entire categories of sites without listing individual URLs. It works across all browsers and apps, and many providers offer online dashboards to monitor traffic and adjust rules in real time. For families, businesses, or anyone managing multiple devices, this is the most effective long-term solution.
Method 4: Block Websites at the Router Level
If you want to block websites for every device on your network — including phones, tablets, and guest devices — you can do it from your router’s settings page. No software to install on any device.
How to Do It
Step 1: Find your router’s address. Go to System Settings > Network > Wi-Fi > Details > TCP/IP. Look for the number next to Router — it’s usually something like 192.168.1.1.
Step 2: Open your router’s admin page. Type that number into your browser’s address bar (e.g., http://192.168.1.1) and press Enter. Log in with your router’s admin username and password. If you’ve never changed these, check the sticker on the bottom of your router or your ISP’s documentation.
Step 3: Find the website blocking feature. Every router brand uses a different name for it. Look for a section called Access Control, URL Filter, Parental Controls, or Website Blocking. Check under the “Security” or “Advanced” menus if you don’t see it right away.
Step 4: Add the sites you want to block. Enter the domain names (e.g., facebook.com, tiktok.com) and save the settings. The block will apply to every device connected to your Wi-Fi.
Pro Tip: Not all routers support website blocking. If yours doesn’t, you can still get network-wide protection by changing your router’s DNS settings to a filtering service like OpenDNS (see Method 3).
Method 5: Use a Third-Party App
If you prefer a visual interface with scheduling, app-level control, and focus sessions, third-party tools fill the gap. Here are some popular options for Mac:
Browwwser — A macOS browser with site and app blocking built directly into the browser engine. No extensions, no workarounds — blocked sites simply don’t load. Includes lock mode, scheduling, and can even close distracting desktop apps. The blocking runs at the OS level, making it extremely hard to bypass.
SelfControl — A free, open-source app that blocks websites for a pre-set period. Once the timer starts, you can’t undo it, even by restarting your Mac. Ideal for productivity and self-discipline.
Cold Turkey — Blocks websites and apps on a schedule. The paid version supports recurring block lists and can’t be easily bypassed.
Focus — Lets you create focus sessions that block specific websites and apps. Integrates with the Pomodoro technique for timed work sprints. Available through Setapp.
1Focus — Lightweight Mac app that blocks websites in Safari and Chrome. Supports scheduling and category-based blocking.
Frequently Asked Questions
Does Screen Time block websites in Chrome?
Not reliably. Screen Time’s web content restrictions are designed primarily for Safari. For Chrome, Firefox, or other browsers, use the hosts file method or a third-party app that works system-wide.
Can someone bypass the hosts file block?
Only if they have admin access. A standard user can’t edit the hosts file. For extra security, combine hosts file blocking with a DNS filter so that even if one method is bypassed, the other still blocks access.
What is the most effective way to block websites on Mac?
DNS filtering combined with the hosts file gives you the strongest protection. DNS filtering handles category-based blocking at the network level, while the hosts file catches specific domains system-wide. Together, they’re very hard to circumvent.
How do I unblock a website I previously blocked?
The process depends on the method you used. For Screen Time, go back to Content & Privacy and remove the site from the Restricted list. For the hosts file, open Terminal, edit the file with sudo nano /etc/hosts, delete the relevant line, save, and flush the DNS cache.
Final Thoughts
There’s no single best way to block websites on a Mac — it depends on who you’re protecting and how determined they are to get around it. Screen Time works for quick parental controls on Safari. The hosts file and DNS filtering offer system-wide, hard-to-bypass solutions. Router-level blocking covers your entire network. And third-party apps add scheduling and focus features.
For maximum security, layer two or three methods together. A DNS filter handles broad categories, the hosts file catches specific URLs, and Screen Time adds an extra barrier for Safari users. That combination covers nearly every scenario.
We built the #1 browser
for |
A macOS browser that blocks distracting sites and apps at the OS level.
Learn more