Guide · macOS 14 and later

How to block websites on a Mac

Three routes, step by step: the built-in Screen Time settings, the hosts file, and a dedicated blocker.

Including the part most guides skip — where each method breaks, and how quickly you can undo it when you change your mind.

Core blocker free forever · v1.22.4 · macOS 14+ · universal binary · Apple-notarised

Pick your route first

There are three genuinely different ways to block a website on a Mac, and they are not interchangeable. macOS Screen Time is free, built in and takes two minutes. Editing /etc/hosts is a system-level trick that needs no software at all. A dedicated blocker app is the heavier option, and the only one designed for the case where the person trying to get past the block is you.

Work through them in that order if you are not sure. Start with the free built-in option, notice how you defeat it, and let that tell you how much friction you actually need. The background on how blocking is enforced underneath all three is in the website blocker for Mac explainer.

Method 1

Block a website with macOS Screen Time

Screen Time is Apple's own parental-controls and self-limiting system, and it is already on your Mac. It can filter adult sites automatically, hold a manual list of sites that are never allowed, and put daily time limits on apps. Nothing to install, nothing to pay.

  1. 1.Open Screen TimeOpen System Settings and choose Screen Time from the sidebar.
  2. 2.Turn on Content & PrivacyClick Content & Privacy and switch it on. This is the section that holds web filtering.
  3. 3.Limit web contentOpen Content Restrictions and set access to web content to the limited option rather than unrestricted. That switches on the built-in adult-site filter and unlocks the manual lists.
  4. 4.Add the sites you want blockedOpen the customise view and add each site to the never-allowed list. Add both the bare domain and the www version, because they are treated as separate entries.
  5. 5.Lock the settings behind a passcodeOptionally set a Screen Time passcode so the restriction cannot be switched off with a single click. Choose one you will not have memorised in a weak moment.
  6. 6.Test it in every browser you useQuit and reopen each browser, then try the blocked site in all of them. Screen Time's web filtering is reported to behave inconsistently between browsers, so verify rather than assume.

Where Screen Time falls short

The restriction lives in System Settings, and whoever is sitting at the Mac can go back and switch it off. That person is you, and the moment you most want to switch it off is precisely the moment the block was supposed to matter. A Screen Time passcode adds a step, but it is a passcode you chose and therefore know.

The second problem is coverage. Screen Time's web filtering is reported to behave inconsistently from one browser to another, so a domain that is properly blocked in one browser may load in another. If you keep a second browser installed, test the block in each one rather than trusting it.

The third is maintenance. The never-allowed list is literal — you are listing hostnames by hand, and the bare domain and the www version count separately, as does every subdomain and every mirror.

Method 2

Block a website by editing /etc/hosts

The hosts file is a plain-text list macOS consults before it asks a DNS server where a domain lives. Point a domain at 127.0.0.1 — your own machine — and requests for it go nowhere. No software, no account, works in every app that uses the normal system resolver.

  1. 1.Open TerminalOpen Terminal from Applications, Utilities. You need an administrator account on the Mac.
  2. 2.Open the hosts fileRun: sudo nano /etc/hosts — then enter your admin password when prompted. Nothing is echoed as you type it.
  3. 3.Point the domain at your own machineAdd one line per hostname at the bottom of the file, for example: 127.0.0.1 example.com and 127.0.0.1 www.example.com. Every subdomain you care about needs its own line.
  4. 4.Save and exitPress Control-O then Return to save, and Control-X to leave nano.
  5. 5.Flush the DNS cacheRun: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder — otherwise macOS may keep serving the old address for a while.
  6. 6.Test, and note how to undo itLoad the site in a browser. To reverse the block, reopen /etc/hosts, delete the lines, save and flush again. That reversal takes about twenty seconds, which is the method's central weakness.

The two commands

sudo nano /etc/hosts
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Why the hosts file is fragile

Start with the obvious one: undoing it costs about twenty seconds. There is no timer, no schedule and no lock — nothing stands between you and the delete key except your own resolve, which is the thing that was already failing when you went looking for a blocker.

Then the coverage gaps. It matches exact hostnames, so example.com and www.example.com are two entries, and any subdomain or mirror you did not list still resolves. It does nothing about a site reached by IP address directly. And it only governs traffic going through the normal macOS resolver — a VPN or proxy that resolves names elsewhere routes straight around it.

Finally, it fails opaquely. A blocked site produces a browser connection error, not an explanation, so weeks later you will be debugging why a perfectly innocent domain is broken on this one Mac. It is a good trick for a handful of domains you never want to see again, and a poor foundation for a focus habit.

Method 3

Block websites with a dedicated blocker

The first two methods block a website. A blocker app is for the different problem underneath: staying blocked once you would rather not be. That is worth naming honestly, because it changes what you should be comparing — not which app has the longest feature list, but which one is hardest for you to defeat.

There is more than one good answer. SelfControl is free and open source, works at the macOS firewall layer so it covers every browser, and once a block is running there is no pause and no early exit — it survives a restart and even deleting the app. Its limits are no scheduling, no app blocking, a 24-hour maximum, and one documented workaround: changing the system clock can end a block early. We compare the free options properly on the free website blockers for Mac page. The steps below are for our own app.

  1. 1.Download and installDownload FocusDragon and drag it to your Applications folder. It needs macOS 14 or later, runs natively on Apple Silicon and Intel, and is Developer ID signed and Apple-notarised, so Gatekeeper opens it without the unidentified-developer warning.
  2. 2.Grant the permissions it asks forApprove the prompts on first launch. These are what let the block run at the system level rather than inside a single browser.
  3. 3.Install the browser extensionsAdd the extension for the browsers you actually use — Safari, Chrome and other Chromium browsers, and Firefox. The extension is what produces a branded block page instead of a confusing connection error.
  4. 4.Create a block and add the sitesMake a new block and add every domain you want gone. Group related sites into one block so you are making a single decision rather than twenty.
  5. 5.Choose a lock typePick from the 10 lock types to match the friction to the temptation: a plain timer for a work session, a schedule for recurring hours, and the heavier locks for the sites you know you will try to talk yourself back into.
  6. 6.Start it, then try to break itStart the block and test it honestly. Quit the app, force-quit the background daemon, drag the app to the Trash mid-block — the block holds and a root daemon restores the app. Try moving your system clock forward too: timers are measured against a clock that a date change cannot move.

What this route buys you

Blocks that hold through the things people actually try. Quitting the app does not lift the block. Force-quitting the background daemon does not lift it. Dragging the app to the Trash mid-block does not lift it either, because a root daemon puts it back. And because timers are measured against a clock that changing the system date cannot move, the classic clock-tampering escape does not work.

You also get scheduling and nine other lock types, so the friction can match the site. A plain timer is right for a Pomodoro; something considerably heavier is right for the site you have already unblocked twice this week.

All of that is in the free version, permanently. Pro is $4.99 paid once — not a subscription, nothing renews — and adds locked mode, Bulletproof Strictness and full statistics. The trial runs 7 days with a card up front, a single $4.99 charge on day 7 unless you cancel, and 14 days to request a refund. Details on the pricing page.

Which method should you use?

Screen Time — for casual drift

You want the site out of the way, not out of reach. Two minutes, no install, easily reversed — which is a feature until it is the problem.

Hosts file — for a permanent, technical block

A handful of domains you are certain about, on a machine you administer, where you are comfortable in Terminal and do not need timers, schedules or a readable block page.

A blocker app — when you are the adversary

You have blocked this site before and unblocked it. You need the block to outlast the mood that made it, on a schedule, across every browser. That is what lock types and system-level enforcement are for.

These also stack. Nothing stops you leaving a few permanent hosts-file entries in place and running a scheduled block on top for working hours.

Frequently asked

More on the full FAQ page.

What is the fastest way to block a website on a Mac?

Screen Time, because it is already installed. Open System Settings, then Screen Time, turn on Content & Privacy, limit web content and add the site to the never-allowed list. It takes about two minutes and costs nothing. The trade-off is that the same two minutes will undo it, since the setting lives in System Settings where you can reach it whenever you want to.

How do I block a website in Safari and Chrome at the same time?

You need something that works below the browser, or something that ships an extension for each one. Editing /etc/hosts is a system-level change so it affects everything using the normal macOS resolver. SelfControl takes the same approach using macOS firewall rules and covers every browser. macOS Screen Time is the weak option here — its web filtering is reported to behave inconsistently from browser to browser. FocusDragon ships extensions for Safari, Chrome and other Chromium browsers, and Firefox, backed by system-level enforcement.

Does the hosts file method block a site in every browser?

Usually, but not dependably. It works at the name-resolution layer, so anything resolving names through the normal macOS resolver is covered. It does not cover a browser or app reaching the site through a VPN or proxy that resolves names elsewhere, it does nothing about an IP address typed in directly, and it only blocks the exact hostnames you listed — a mirror domain or an unlisted subdomain sails straight through.

How do I unblock a website I blocked on my Mac?

It depends how you blocked it. In Screen Time, remove the entry from the never-allowed list. For the hosts file, run sudo nano /etc/hosts, delete the lines you added, save, and flush the DNS cache with sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. In a blocker app it depends on the lock: some let you stop immediately, and the stricter ones deliberately do not — with SelfControl, for instance, a running block has no early exit at all.

Can I block websites on a schedule, like work hours only?

Not with the hosts file, and not with SelfControl, which has no scheduling and a 24-hour maximum timer — every block there is one you start by hand. Screen Time can put daily time limits on apps. FocusDragon has scheduling as one of its 10 lock types, so a block can switch itself on for a recurring window without you deciding again each morning.

How do I stop myself from simply undoing the block?

By choosing a method whose undo is expensive. The hosts file has effectively no friction — twenty seconds and an admin password. Screen Time can be switched off in System Settings, though a Screen Time passcode adds a step. SelfControl is at the other extreme: once a block is running there is no pause and no early exit, and it survives a restart and even deleting the app, with one documented workaround via changing the system clock. FocusDragon keeps blocks running through quitting the app, force-quitting the daemon and dragging the app to the Trash, and its timers cannot be shortened by changing the system date.

Can I block websites on a Mac for free?

Yes, and with more than one tool. Screen Time is built into macOS. SelfControl is free and open source. FocusDragon's core blocker is free forever — unlimited blocks, all 10 lock types, the Safari, Chrome/Chromium and Firefox extensions, and system-level enforcement. We compare the free options in detail on our free Mac website blocker page.

Do I need admin access to block a website on a Mac?

For the hosts file, yes — editing /etc/hosts requires sudo and an administrator password. Screen Time settings can be changed by the user of the account. Installing any blocker app that enforces below the browser will also need an administrator approval at install time. On a Mac managed by an employer or school you may not have the rights to do any of it.

Block it once, properly

Unlimited blocks, all 10 lock types, Safari, Chrome and Firefox extensions — free, with no time limit. Set your first block in about a minute.

v1.22.4 · macOS 14+ · Apple Silicon & Intel · Pro is $4.99 once, if you ever want it

Also worth reading: the free Mac blockers compared and the full website blocker explainer.