How to block websites on Mac
Updated December 2026
There are three reliable ways to block websites on a Mac: macOS built-in Screen Time (best native option for Safari and system-wide limits with a passcode), editing /etc/hosts in Terminal (free system-wide DNS block across all browsers), or installing a strict browser blocker like Focus AI inside Chrome, Edge, Brave, or Firefox. Screen Time lives in System Settings > Screen Time > Content & Privacy > Content Restrictions and lets a friend or parent lock blocked websites behind a 4-digit Screen Time passcode. Editing /etc/hosts works across Safari, Chrome, and Firefox without extra software once you run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder, though it blocks entire domains (including useful YouTube tutorials) and can be undone by anyone with the Mac admin password. If you work primarily in Chrome, Arc, Brave, Edge, or Firefox and want context-aware AI blocking that keeps tutorials and work docs open while blocking feeds and Shorts, Focus AI runs right in your browser and is free for 3 AI sessions and 3 always-blocked sites.
Every working method on Mac (macOS), compared
| Method | Scope | Cost | Hard to undo? | Best for |
|---|---|---|---|---|
| macOS Screen Time | Safari + macOS Web Content filter | Free (built into macOS) | High if someone else sets passcode | Native Mac blocking & Safari users |
| Mac /etc/hosts file | Chrome, Safari, Firefox, Edge | Free | Low if you know your Mac admin password | Permanent system-wide domain blocking |
| Focus AI browser extension | Chrome, Arc, Brave, Edge, Firefox | Free (3 sessions + 3 sites) / Pro | High (Quit Wall + Passcode Lock) | Context-aware work focus (keep tutorials) |
| Cold Turkey / FocusMe | All Mac browsers + native apps | Paid ($39+ / subscription) | Very High (OS-level lock) | Users who escape across multiple browsers |
Method 1: Use macOS Screen Time (built-in, supports a passcode)
- Open System Settings > Screen Time and turn Screen Time on for your Mac.
- Click Lock Screen Time Settings and have a trusted friend, partner, or parent choose a 4-digit Screen Time passcode you do not know.
- Open Content & Privacy > App Store, Media, Web, & Games (or Content Restrictions depending on macOS version), turn on Content & Privacy, and set Access to Web Content to Limit Adult Websites.
- Click Customize next to Limit Adult Websites, scroll to Restricted, click +, and add each website URL you want blocked.
Method 2: Block websites on Mac via /etc/hosts (free, all browsers)
- Generate exact 127.0.0.1 and ::1 entries (including www and mobile subdomains) with our free Hosts File Website Blocker Generator.
- Open Terminal and run: sudo nano /etc/hosts, then enter your Mac login password.
- Scroll to the bottom, paste the blocklist, press Control-O then Enter to save, and Control-X to exit.
- Flush macOS DNS cache immediately with: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder, then quit (Cmd+Q) and reopen your browsers.
Method 3: Context-aware blocking on Mac with Focus AI
- Install Focus AI in Chrome, Brave, Arc, Edge, or Firefox on your Mac (free for 3 AI focus sessions and up to 3 always-blocked sites).
- Enable Allow in Incognito in your browser's extensions page so private windows stay locked.
- Add pure time sinks to Always-On Site Blocker (with optional Friend/Parent Passcode Lock on Pro) and run AI focus sessions whenever you need YouTube tutorials or Reddit threads open for real work.
127.0.0.1 + ::1 blocklist with our free Hosts File Website Blocker Generator →Loopholes to close on Mac (macOS)
On Mac, Screen Time's Web Content filter applies reliably in Safari, while third-party browsers (Chrome, Firefox, Brave) sometimes ignore Screen Time website lists unless you also block those browsers or use a browser extension inside them. Meanwhile, /etc/hosts can be bypassed if Chrome's Secure DNS (DoH) is turned on or if iCloud Private Relay is active in Safari. Need a native system-wide Mac app from us? Join the Focus AI for Mac waitlist at /mac.
Try Focus AI live before you install
Pick or type a real work task, then test any URL to see what stays open and what gets blocked.
This YouTube video matches your task "Building Next.js app", so Focus AI lets it play while keeping Shorts blocked.
Block distractions on Mac without breaking your work
Context-aware AI sessions, Always-On Site Blocker (3 sites free, unlimited Pro), and Friend/Parent Passcode Lock.
Add Focus AI to ChromeFrequently asked questions
Does macOS Screen Time block websites in Chrome on a Mac?
macOS Screen Time's Web Content filter enforces reliably in Safari, but often does not filter websites inside Google Chrome or Firefox. Pair Screen Time with Focus AI inside Chrome/Firefox, or restrict unused browsers via Screen Time App Limits.
Why did editing /etc/hosts on Mac not block a site in Chrome or Safari?
Three common causes: forgetting to flush DNS (sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder), missing IPv6 (::1) lines, or having Chrome Secure DNS / Safari iCloud Private Relay enabled.
Is there a native Focus AI Mac app?
Right now Focus AI runs inside Chrome, Arc, Brave, Edge, and Firefox on macOS. You can join our waitlist for the standalone native Mac app at getfocusai.com/mac.