How to block websites on Firefox
Updated December 2026
To block websites on Mozilla Firefox, install an official Firefox add-on such as Focus AI or LeechBlock NG from addons.mozilla.org and grant it permission to run in Private Windows inside about:addons. Firefox does not include a built-in personal site blocker in Settings, though IT administrators and power users can enforce unremovable browser-level rules via Firefox's enterprise policies.json file (WebsiteFilter). If you prefer zero add-ons, editing your Mac, Windows, or Linux hosts file blocks domains inside Firefox too, provided you disable DNS over HTTPS (DoH) in Firefox Settings > Privacy & Security > DNS over HTTPS. Standard Firefox blockers like LeechBlock NG excel at static schedules yet cannot tell a helpful YouTube lecture from YouTube Shorts. Focus AI's official Firefox add-on brings context-aware AI focus sessions, Always-On Site Blocker (3 sites free, unlimited Pro), Quit Wall strict mode, and Friend/Parent Passcode Lock directly to Firefox.
Every working method on Mozilla Firefox, compared
| Method | Scope | Cost | Hard to undo? | Best for |
|---|---|---|---|---|
| Focus AI (Firefox Add-on) | Firefox (Mac, Windows, Linux) | Free (3 sessions + 3 sites) / Pro | High (Quit Wall + Passcode Lock) | Context-aware deep work & strict mode |
| LeechBlock NG | Firefox (Mac, Windows, Linux) | Free & open source | Medium (password/delay options) | Power users who enjoy regex rule sets |
| Firefox policies.json (WebsiteFilter) | All Firefox profiles on device | Free (needs admin) | High (requires root/admin file edit) | Hard enterprise or self-managed locks |
| OS Hosts file | Firefox + all other browsers | Free | Low for admins | Permanent system-wide domain blocks |
Method 1: Install Focus AI from Mozilla Add-ons (fastest)
- Open addons.mozilla.org and install the official Focus AI Firefox add-on (addons.mozilla.org/en-US/firefox/addon/focus-ai/).
- Visit about:addons in Firefox, click Focus AI, and set Run in Private Windows to Allow so Private Browsing cannot bypass your lock.
- Add up to 3 always-blocked sites free or type your current task to start a context-aware focus session.
Method 2: Block websites natively in Firefox with policies.json (advanced)
- Create a distribution folder inside your Firefox installation directory (on Windows: C:\Program Files\Mozilla Firefox\distribution\; on Mac: /Applications/Firefox.app/Contents/Resources/distribution/).
- Create policies.json with a WebsiteFilter policy listing blocked URL patterns such as {"policies": {"WebsiteFilter": {"Block": ["*://*.instagram.com/*", "*://*.reddit.com/*"]}}}.
- Restart Firefox and visit about:policies to verify the WebsiteFilter policy is active.
Method 3: Use your OS hosts file (and check Firefox DoH)
- Generate a 127.0.0.1 and ::1 blocklist with our free Hosts File Website Blocker Generator and apply it to your Mac, Windows, or Linux hosts file.
- In Firefox Settings > Privacy & Security > DNS over HTTPS, set protection to Off (or exclude your blocked domains) because Firefox's built-in Cloudflare/NextDNS DoH bypasses local hosts files by default.
127.0.0.1 + ::1 blocklist with our free Hosts File Website Blocker Generator →Loopholes to close on Mozilla Firefox
Firefox's single biggest surprise when blocking websites via /etc/hosts is DNS over HTTPS (DoH): Firefox enables Cloudflare DoH by default in many regions, which queries external DNS directly and completely ignores your local hosts file until DoH is disabled. For extensions, always verify 'Run in Private Windows: Allow' inside about:addons.
Try Focus AI live before you install
Pick or type a real work task, then test any URL to see what stays open and what gets blocked.
This YouTube video matches your task "Building Next.js app", so Focus AI lets it play while keeping Shorts blocked.
Block distractions on Firefox without breaking your work
Context-aware AI sessions, Always-On Site Blocker (3 sites free, unlimited Pro), and Friend/Parent Passcode Lock.
Add Focus AI to ChromeFrequently asked questions
Does Focus AI have an official Firefox add-on?
Yes. Focus AI is published on Mozilla Add-ons (addons.mozilla.org/en-US/firefox/addon/focus-ai/) as well as the Chrome Web Store.
Why did my hosts file not block websites in Firefox?
Firefox enables DNS over HTTPS (DoH) by default for many users, which bypasses the OS hosts file. Open Firefox Settings > Privacy & Security > DNS over HTTPS and switch it to Off if you rely on /etc/hosts.
How does Focus AI compare to LeechBlock NG on Firefox?
LeechBlock NG is free, open source, and unbeatable if you want complex static time-window rules. Focus AI replaces manual rule building with context-aware AI sessions (keeping YouTube tutorials and Reddit debugging threads open) plus Quit Wall strict mode and Friend/Parent Passcode Lock.