Domain-blocking focus tool for macOS that pairs a command-line interface with a privileged daemon to enforce PF firewall rules during timed focus sessions.
Run the install script to download the latest notarized release, place zblock/zblockd under ~/.zblock/bin, and print PATH instructions:
curl -fsSL https://raw.githubusercontent.com/lorenries/zblock/main/scripts/install.sh | bash- Use
ZBLOCK_VERSION=v0.x.yto pin a specific tag. - Set
ZBLOCK_INSTALL_DIRorZBLOCK_BIN_DIRto customize the destination. - After installation, ensure
~/.zblock/binis on yourPATH(the script tells you what to add).
- Download the archive matching your platform/architecture from the releases page (
zblock-<version>-<OS>-<ARCH>.zip). - Extract the binaries:
unzip zblock-<version>-<OS>-<ARCH>.zip
- Move the executables into your preferred locations, for example:
sudo mv zblock /usr/local/bin/ sudo mv zblockd /usr/local/libexec/
sudo zblock initAdd domains to the default group:
zblock add x.com news.ycombinator.comAdd domains to a custom group:
zblock add --group social reddit.com instagram.comList configured domains:
zblock list
zblock list --group social --jsonStart a timed block for every group:
zblock start --for 45mTarget a single group and enable DNS lockdown:
zblock start --for 90m --group social --dns-lockdownDuring a session, the daemon resolves configured domains, maintains PF tables for IPv4/IPv6 targets, and (optionally) blocks DNS and known DoH egress.
zblock status
zblock status --jsonShows whether a focus session is active, the remaining time, targeted groups, and counts of resolved addresses.
sudo zblock uninstallStops and disables the launchd service, clears PF anchors/tables, removes installed binaries, and deletes runtime state. Pass --purge to remove the user config as well. You cannot uninstall while a focus session is active.
- Ensure PF is available (
sudo pfctl -s info). The daemon logs to/var/log/zblock/daemon.log. - Use
zblock listto confirm domains were added;zblock statusafterstartshould report resolved targets. - If network access still succeeds during a session, check that launchd is running the daemon (
sudo launchctl print system/com.zblock.daemon).