Skip to content

Website blocking

Blocking is what makes Deep Focus different from a timer. Add a domain once; from then on it is unreachable system-wide for exactly as long as a focus runs.

The blocklist lives on your server and is applied per focus:

  1. When a focus starts, the app tells the blocking helper which domains to block.
  2. The helper (a small root LaunchDaemon) writes the domains into a marked section of /etc/hosts, pointing them at your own machine, and flushes the DNS cache.
  3. Blocks stay on while a focus is paused, and are removed immediately when the focus ends (or at the next boot or app start as a safety net).

Every browser goes through /etc/hosts, so this works in Safari, Chrome, Firefox, and anything else, without installing a proxy or a browser extension.

Plain DNS blocking would show an ugly connection error on https sites. The helper also runs a small local web server:

  • It generates a local certificate authority on your machine (during the one-time installer) and marks it trusted.
  • While a focus runs, it signs certificates for exactly the domains on your blocklist, so visiting them shows the block page instead of an error, even on HSTS sites.
  • Certificates for a domain only exist while that domain is actively blocked.

Everything is generated locally on your Mac; no third party is involved and nothing leaves the machine. The blocked domains never actually load.

  • Browsers with Secure DNS (DNS over HTTPS) enabled can bypass /etc/hosts. If blocking seems inconsistent in Chrome or Firefox, turn off Secure DNS in that browser. Safari is unaffected.
  • Browser DNS cache can lag a few seconds after a block starts or ends. A hard refresh (⌘⌥R in Safari) clears it.
  • The helper needs a one-time install with sudo; without it the app works fine but does not block; the Blocklist tab will say so.