How to block websites on Mac
Updated 2026-07-03 ยท 12 min read
You can block websites on Mac with built-in Screen Time limits, web content restrictions, the hosts file, strict website timers, or a focus app like Nudge. The right method depends on whether you need a one-off block or a repeatable work-session system.
Quick answer
For a reusable daily workflow, use Nudge: create a preset, choose the Mac apps that stay available, add distracting websites to block, and start from the menu bar. For a free built-in baseline, use Screen Time. For a strict one-off website timer, use SelfControl.
Pick the method by job
Best for repeatable work
Nudge
Saved presets with allowed apps and blocked sites for coding, writing, study, or admin.Best built-in option
Screen Time
Good for basic app and website limits when you do not want another app.Best advanced manual block
/etc/hosts
Useful for technical users who want a system-level domain block and can maintain it.Website blocking methods for Mac
Start with the lightest method that can actually hold your focus block. A strict method is not always better if it is too annoying to use every day.
| Method | Best for | Effort | Main limit |
|---|---|---|---|
| Nudge | Repeatable focus sessions | Low | Mac-only today. Built for work sessions, not phone blocking. |
| Screen Time app and website limits | Built-in limits without installing anything | Medium | Useful baseline, but not built around task-specific presets. |
| Screen Time web content restrictions | Parental controls or allow-only browsing | Medium | Can be too broad for adult work sessions. |
| /etc/hosts file | Advanced system-level blocks | High | Manual, easy to misconfigure, and awkward to toggle per work mode. |
| SelfControl | Free strict website timers | Low | No app blocking, presets, menu bar workflow, or analytics. |
Block websites with Nudge
Use this when the same distraction pattern shows up during real Mac work.
Nudge is the easiest option when website blocking is part of a broader work session. Instead of only blocking a list of domains, you create a preset for the work you want to do. The right apps stay available. Distracting websites are blocked. The session starts from the menu bar.
- Open Nudge and create a preset, such as Writing, Deep Work, Study, or Admin.
- Add the Mac apps that should stay available during the session.
- Add distracting websites that should be blocked in the browser.
- Start the preset from the menu bar when the work block begins.
- Reuse the preset next time instead of rebuilding the blocklist.
This is the best fit for people who do not just want to block one website. They want the Mac environment to match the task.
Use Screen Time app and website limits
Screen Time is the built-in baseline for app and website limits on Mac.
Screen Time can set limits for apps and websites without installing another tool. It is useful when you want a simple daily cap, especially for broad usage control.
- Open System Settings on your Mac.
- Click Screen Time in the sidebar.
- Turn Screen Time on if it is not already enabled.
- Open App Limits and add a limit for the app or website category you want to restrict.
- Choose the time allowance and save the limit.
The limit model is good for reducing usage. It is less good for task-specific work sessions. If you need different rules for writing, coding, and admin, presets are usually easier than daily allowance limits.
Use Screen Time web content restrictions
This is better for parental controls or allow-only browsing than for flexible adult focus.
Screen Time also includes content and privacy controls. Depending on your macOS version, you can restrict web content, limit adult websites, or create a stricter allow-only browsing setup.
- Open System Settings.
- Go to Screen Time.
- Open Content & Privacy settings.
- Choose the web content setting that matches your goal.
- Add blocked or allowed websites where the interface provides that option.
Use this when you want broad web access rules. It is usually too blunt if the goal is to protect a 90-minute focus block while leaving normal browsing alone afterward.
Block websites with the Mac hosts file
This is an advanced manual method. Use it only if you are comfortable editing system files.
The hosts file can point a domain back to your own Mac, which prevents the domain from resolving normally. This can work for simple site blocks, but it is manual and easy to manage badly.
sudo nano /etc/hostsAdd both the root domain and common subdomain:
127.0.0.1 example.com
127.0.0.1 www.example.comThen flush DNS:
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponderThis method is not a friendly daily workflow. It does not know what task you are doing, it does not give you presets, and undoing it requires editing the file again.
Use Safari settings for lighter website control
Safari settings can reduce pop-ups and unwanted content, but they are not a full focus blocker.
Safari has per-website settings, pop-up controls, and content blocker support. These help reduce unwanted interruptions, but they should not be confused with a durable focus-session website blocker.
- Open Safari.
- Choose Safari, then Settings.
- Open the Websites tab.
- Review settings such as Pop-up Windows, Content Blockers, Auto-Play, and Reader.
- Use these settings to reduce noise, then use Screen Time, Nudge, SelfControl, or hosts file rules for actual website blocking.
Use SelfControl for a free strict timer
SelfControl is useful when the job is simple: block websites for a fixed period.
SelfControl is free and open-source. You add sites or mail servers, set a timer, and start. The block continues until the timer expires, even if you restart the Mac or delete the app.
That strictness is useful for one-off blocks. It is less useful when you need app boundaries, reusable work presets, menu bar starts, or session history. Compare the two here: Nudge vs SelfControl.
What should you use?
Use Screen Time if you want a built-in usage cap. Use Content & Privacy restrictions if you want parental-control style browsing rules. Use the hosts file if you are technical and want a manual system-level block. Use SelfControl if you want a free strict timer.
Use Nudge if the real job is repeatable focus: the right apps stay open, distracting websites stay blocked, and the work mode is easy to start again tomorrow.
FAQ
What is the easiest way to block websites on Mac?
The easiest repeatable method is a focus app like Nudge: create a preset, add distracting websites, choose the apps that stay available, and start the session from the menu bar.
Can I block websites on Mac without installing an app?
Yes. You can use Screen Time for app and website limits, web content restrictions, or the Mac hosts file. Those methods work best as baselines, not flexible work-session presets.
Can Safari block websites by itself?
Safari has website settings, pop-up controls, and content blocker support, but it is not a complete focus-session website blocker by itself. Use Screen Time, a blocker app, or the hosts file for stronger blocking.
Is the hosts file a good way to block websites?
The hosts file can block domains at the system level, but it is manual and easy to manage poorly. It is better for advanced users than for daily focus sessions.
Can Nudge block apps and websites at the same time?
Yes. Nudge is built around Mac focus sessions with allowed app boundaries and distracting websites blocked during the session.
Make website blocking part of the work session
Create a preset, keep the apps you need, block distracting sites, and start from the menu bar. 7-day free trial, no card.
Download for macOS