How to block websites on Safari (Mac & iPhone)

Sameed Ahmad
By Sameed Ahmad, who builds Focus AI (so read the Focus AI parts with that in mind).
Updated December 2026

To block websites on Safari on a Mac, iPhone, or iPad, the best native method is Apple's built-in Screen Time Content & Privacy Restrictions, which syncs across iCloud devices and supports a 4-digit passcode that a friend or parent can hold. On a Mac, you can also block websites in Safari for free without installing anything by editing /etc/hosts in Terminal (remembering to disable iCloud Private Relay if blocked domains still resolve). Let's be completely upfront: Focus AI is a browser extension for Chrome, Edge, Brave, and Firefox, not a Safari or iOS extension (though we have a native Mac app waitlist at /mac). If you stay on Safari, use Screen Time + a friend-held passcode below, or pair it with a Safari-native tool like 1Focus or Freedom. If your work happens on a Mac laptop and you want an AI website blocker that lets YouTube tutorials and Reddit debugging threads through while blocking Shorts and feeds, running your deep-work sessions in Chrome, Arc, Brave, or Firefox with Focus AI solves what Screen Time's blunt domain list cannot.

Every working method on Safari (Mac & iPhone), compared

MethodScopeCostHard to undo?Best for
Apple Screen Time (Web Content)Safari on Mac, iPhone & iPadFree (built into Apple OS)High if someone else sets passcodeNative Safari & iPhone blocking
Mac /etc/hosts fileSafari + all Mac browsersFreeLow for admins; watch Private RelayMac-only permanent domain lists
1Focus / Freedom / OpalSafari / macOS / iOSPaid subscriptionHigh (locked modes)Apple-only multi-device domain blocking
Focus AI (in Chrome/Brave/Firefox)Chrome, Edge, Brave, Firefox on MacFree (3 sessions + 3 sites) / ProHigh (Quit Wall + Passcode Lock)Context-aware blocking (keep tutorials)

Method 1: Block websites in Safari on iPhone & iPad via Screen Time

  1. Open Settings > Screen Time and turn on Share Across Devices if you want the rule synced to your Mac.
  2. Tap Lock Screen Time Settings and ask a partner, friend, or parent to enter a 4-digit passcode you do not know.
  3. Go to Content & Privacy Restrictions (toggle ON) > App Store, Media, Web, & Games > Web Content.
  4. Choose Limit Adult Websites, tap Add Website under Never Allow, and enter each distracting domain (such as instagram.com or x.com).

Method 2: Block websites in Safari on Mac via Screen Time

  1. Open System Settings > Screen Time > Content & Privacy and toggle Content & Privacy on.
  2. Open Content Restrictions (or Store, Web, Siri & Game Center Content on newer macOS releases) and set Web Content to Limit Adult Websites.
  3. Click Customize, add domains under Restricted, and lock Screen Time Settings with a friend-held passcode.

Method 3: Block websites in Safari on Mac with /etc/hosts

  1. Use our free Hosts File Website Blocker Generator to build 127.0.0.1 and ::1 lines, then paste them into sudo nano /etc/hosts.
  2. Flush DNS via sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder.
  3. Important Safari caveat: if you subscribe to iCloud+ and turn on iCloud Private Relay, Safari proxies DNS through Apple relays and bypasses /etc/hosts. Turn off Private Relay (or use Screen Time instead) if hosts rules fail in Safari.
Using the hosts file on Mac or Windows? Skip manual typing and build a clean 127.0.0.1 + ::1 blocklist with our free Hosts File Website Blocker Generator →
Common bypasses on Safari (Mac & iPhone)

Loopholes to close on Safari (Mac & iPhone)

Three Safari-specific traps catch Mac and iPhone users: setting your own Screen Time passcode (you will tap 'Ignore Limit' or enter it within a week), iCloud Private Relay bypassing /etc/hosts on Mac, and Screen Time blocking whole domains so you cannot watch a YouTube tutorial without unblocking all of youtube.com. For desktop deep work where context matters, running work sessions in Chrome, Arc, or Firefox with Focus AI (and hiding Safari during work hours) gives you task-aware blocking that Safari's domain list lacks.

Interactive Demo · Zero Install

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.

youtube.com/watch?v=nextjs-app-router-guide

This YouTube video matches your task "Building Next.js app", so Focus AI lets it play while keeping Shorts blocked.

ALLOWED
Session check log for “Building Next.js app”
Simulated client-side demo. In Chrome, Focus AI runs live on every tab during active sessions.Add Focus AI to Chrome
Privacy & pricing: Focus AI checks only the URL and brief page snippet during active sessions. Banking, login, email, and form inputs are skipped. Nothing is stored as browsing history or sold. Free for 3 AI focus sessions and up to 3 always-blocked sites, then $4.99/week, $14.99/month, or $79/year (save 56%).
FUTURE YOU IS WATCHINGLOCK IN

Block distractions on Safari 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 Chrome
Free for 3 AI focus sessions + 3 always-blocked sites · 30-second setup · No account needed

Frequently asked questions

Does Focus AI work as a Safari extension?

No, not currently. Focus AI works in Chrome, Edge, Brave, Arc, and Firefox on Mac and Windows. For Safari specifically, use Apple Screen Time with a friend-held passcode, or join our native Mac app waitlist at getfocusai.com/mac.

Why did /etc/hosts not block a website in Safari on my Mac?

Most often because iCloud Private Relay is enabled under System Settings > Apple ID > iCloud > Private Relay, which routes Safari DNS around your local /etc/hosts file.

Can Apple Screen Time block YouTube Shorts without blocking all of YouTube in Safari?

No. Screen Time's Never Allow list works at the domain level (youtube.com) and cannot filter /shorts separately from tutorial videos.

Block websites on other devices & browsers