On macOS 15 or 26, open System Settings > Screen Time > Content & Privacy > App Store, Media, Web, & Games. Under Safari, choose Limit Adult Websites, click Customize and add the site to the Restricted list. That covers Safari. For Chrome, Firefox and other browsers, add the site to the hosts file or use a filtering DNS.
Block a website in Safari with Screen Time
Screen Time is built into every Mac and costs nothing. The menus depend on your macOS version, so check yours first: Apple menu > About This Mac. The steps below are Apple's for macOS 15 Sequoia and macOS 26 Tahoe.
- Open Screen TimeChoose Apple menu > System Settings, then click Screen Time in the sidebar (you may need to scroll down). If Screen Time is off, click App & Website Activity, then Turn On App & Website Activity.
- Turn on Content & PrivacyClick Content & Privacy and turn it on if it isn't on already.
- Choose Limit Adult WebsitesClick App Store, Media, Web, & Games. Under Safari, select Limit Adult Websites. This also filters many adult sites automatically.
- Add the site to the Restricted listClick Customize, click the Add button below the Restricted list, enter the address (for example reddit.com), then click Done. Add each address you want gone.
- Lock the settingsBack on the Screen Time page, scroll down and turn on Lock Screen Time Settings, then enter a four-digit passcode twice. It works best when someone else picks the code.
The stricter option, Allowed Websites Only, blocks everything except a list you approve. It suits a child's account more than your own.
How to block websites in Chrome, Firefox and other browsers on Mac
Apple documents this web filter under the Safari heading, and that is where it is reliable. Don't count on the Restricted list in Chrome, Firefox, Edge or Brave. A second browser is the usual way around a Safari-only block.
You have three ways to close that gap:
- Limit the other browsers. On macOS 15 and 26, go to Screen Time > App Limits > Add Limit, select the browser, set 1 minute for Every Day and select "Block at end of limit".
- Use the hosts file. It works in every browser and blocks the exact addresses you list.
- Use a filtering DNS. It blocks a whole category, such as adult content, on every browser and app.
Chrome and Firefox have no simple built-in block list for personal use. Uninstalling browsers you don't need is the simplest fix of all.
Block a website on every browser with the hosts file
The hosts file is a short list your Mac checks before it asks the internet where a site lives. Point a site at 0.0.0.0 and every browser on the Mac fails to load it. You need an administrator password.
- Open TerminalIt is in Applications > Utilities, or press Command-Space and type Terminal.
- Open the hosts fileType sudo nano /etc/hosts and press Return. Enter your Mac password. Nothing appears while you type it; that is normal.
- Add one line per addressUse the arrow keys to go to the bottom and add lines such as 0.0.0.0 reddit.com and 0.0.0.0 www.reddit.com. Leave the existing localhost lines alone.
- Save and closePress Control-O, then Return to save, then Control-X to exit.
- Clear the DNS cacheType sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder and press Return. Quit and reopen your browser.
Use DNS filtering to block whole categories
Listing sites one by one never ends for adult content or gambling. A filtering DNS service refuses lookups for a whole category instead. One free example is Cloudflare's 1.1.1.1 for Families: the addresses 1.1.1.3 and 1.0.0.3 block malware and adult content.
- Open your network settingsChoose Apple menu > System Settings, click Network, then click the service you use, such as Wi-Fi.
- Open the DNS tabClick Details, then click DNS (you may need to scroll down).
- Replace the DNS serversUnder DNS Servers, click the Add button and enter 1.1.1.3, then add 1.0.0.3. Select any other servers in the list and click the Remove button. When you're finished, click OK.
- Repeat for every network serviceThe setting is per service, so do the same for Ethernet or any other connection you use.
The limits: the provider decides what counts as adult, an admin can switch the servers back, and a VPN or a browser set to its own secure DNS provider can skip the Mac's setting. If you use Chrome or Firefox, check their secure DNS settings too.
How to block porn on a Mac
Combine the layers: Limit Adult Websites for Safari, a family DNS such as 1.1.1.3 for every other browser and app, and a Screen Time passcode you don't know. Then do the same on your phone, because a block on one device moves the habit to the next. Our guide to blocking porn on iPhone covers that side.
Parental controls on a MacBook Air (or any Mac)
Give your child their own user account, set up as a standard user rather than an administrator, and add them to Family Sharing. Then:
- On macOS 15 and 26: System Settings > Screen Time, choose your child from the Family Member pop-up menu, click Set Up Screen Time For Your Child and follow the steps. Apple notes that for children under 13 the web content filter blocks adult content by default.
- On macOS 27: System Settings > Family > your child's name > Apps & Websites. Click Restrictions, then Filtering under Websites, and choose Limit Adult Websites or Approved Websites Only. To block one site, click the Add button and enter it.
- Set a Screen Time passcode your child doesn't know.
On macOS 27, Apple says Ask to Browse works in Safari and other supported browser apps, which closes part of the second-browser gap for children.
Why every Mac blocker has an off switch
| Method | Covers | How it gets undone |
|---|---|---|
| Screen Time Restricted list | Safari | Anyone who knows the Screen Time passcode |
| Screen Time App Limits | Whole browser apps | Same passcode; without one, you can simply allow more time |
| Hosts file | Exact addresses, every browser | Admin password and one Terminal command |
| Filtering DNS | Whole categories, every app | Admin password, a VPN or a browser's own DNS |
If you are blocking a site for yourself, the weak point is you at 1 a.m. with the password in your head. Hand the Screen Time passcode to someone you trust, or add something you would rather not lose. A commitment contract is the classic way to do that.
Commitment contractWrite a clear rule, an end date, a referee and what’s on the line. Sign it, print it, stick to it.Questions
How do I block Reddit on a MacBook?
Add reddit.com and www.reddit.com to the Restricted list in Screen Time (Content & Privacy > App Store, Media, Web, & Games > Customize) for Safari, and add the same addresses to the hosts file for other browsers. Our Reddit guide covers the app and Reddit's own NSFW setting.
How do I set up parental controls on my MacBook Air?
Create a standard user account for your child, add them to Family Sharing, then set up Screen Time for them. On macOS 15 and 26 that starts in System Settings > Screen Time; on macOS 27 it is System Settings > Family > your child's name.
How do I block a website on Safari on a Mac?
Use Screen Time: Content & Privacy > App Store, Media, Web, & Games, select Limit Adult Websites, click Customize and add the site under Restricted. Lock it with a Screen Time passcode.
How do I block websites on Chrome on a Mac?
Chrome has no built-in block list for personal use. Add the site to the hosts file, which every browser respects, or switch the Mac to a filtering DNS for whole categories. You can also limit the Chrome app itself to one minute a day with Screen Time.
Can I block a website so that even I can't undo it?
Not completely. Every method on a Mac can be reversed by whoever holds the admin password or Screen Time passcode. What you can change is how easy that is: give the passcode to someone else, or attach a consequence to switching protection off.
Related guides
- How to block a website on iPhone, and make the block stickBlock any website on iPhone with Screen Time: exact steps for iOS 18, 26 and 27, what the filter misses, and how to make a block you can't undo in two taps.
- How to block Reddit on iPhone and Mac, or just its NSFW postsBlock Reddit on iPhone and Mac with Screen Time and the hosts file, hide NSFW posts with Reddit's own setting, and know which method holds up at 1 a.m.
- How to block porn on iPhone and iPad, and keep it blockedBlock porn on iPhone and iPad with Screen Time, SafeSearch and a DNS filter: steps for iOS 18, 26 and 27, the gaps people slip through, and how to close them.
- How to stop doomscrolling: nine changes that work on your phoneWhy you doomscroll and how to stop: grayscale, batched notifications, a Screen Time schedule, a phone-free bedroom and something better to do with your hands.
Sources
- Apple, Change App Store, Media, Web, & Games settings in Screen Time on Mac (Mac User Guide)
- Apple, Set time limits for apps and websites in Screen Time on Mac (macOS 26)
- Apple, Set, change, or remove a Screen Time passcode on Mac
- Apple, Change DNS settings on Mac
- Apple, Use Ask to Browse to approve the websites your child can access
- Cloudflare, Set up 1.1.1.1 (1.1.1.1 for Families)
General information, not medical or psychological advice. If you’re struggling, talk to a doctor, a therapist or one of the helplines on our responsible use page.
