Guide
How to block websites on Windows 10 and 11
Windows has two free ways to block a site built in: the hosts file for every browser, and Family Safety for a child's account. Both work. Both are also easy for an adult to undo, which is where an app comes in.
1. The hosts file: free, every browser
- Press Start, type Notepad, right-click it and choose Run as administrator.
- Open
C:\Windows\System32\drivers\etc\hosts(set the file type to "All files" to see it). - Add one line per address, with and without
www.:0.0.0.0 youtube.comand0.0.0.0 www.youtube.com. - Save, then open Command Prompt and run
ipconfig /flushdns. Restart your browser.
The site now fails to load in Chrome, Edge, Firefox and every other browser. To undo it, delete the lines. The Chrome guides list the exact lines for 15 sites, including the extra addresses YouTube and TikTok use.
2. Microsoft Family Safety: for a child's account
If the PC has a child's Microsoft account in your family group, Family Safety can block particular sites, or allow only the sites you approve. Its web filters work in Microsoft Edge, so they're meant to be paired with blocking other browsers in the same settings. It isn't built for blocking your own sites.
3. Chrome or Edge policy: blocks that survive extensions
Chrome and Edge both read a URLBlocklist policy from the registry, which an extension can't switch off. The steps and a ready-made .reg file are in how to block a website on Chrome and how to block a website on Edge.
4. An app that covers the whole PC
Every method above stops at the browser or the account it lives in. Cold Turkey is the best-known app for the whole computer: Domains, URLs, wildcards, keywords, or the whole internet with exceptions. Pro blocks apps and can lock the whole computer (Frozen Turkey). Windows and macOS, with extensions for the major browsers. It closes browsers it doesn't cover.
Onus works differently from both: sites stay sealed until you've worked for them. In Chrome and Edge, every 25 minutes on your work sites buys 10 minutes on the sites you sealed, the bank holds up to 2 hours, and it resets at midnight. Onus for Windows adds the rest of the PC: it seals apps like Discord, Steam and games, and other browsers too, and time in work apps like VS Code, Word and Figma earns minutes back: every 25 minutes buys 10. It keeps running as a Windows service when you close the window, and it comes with the yearly and lifetime plans.
Which to pick
- One site, gone everywhere, free: the hosts file.
- A child's PC: Family Safety.
- The hardest wall on your own PC: Cold Turkey.
- Your blocks keep getting switched off: Onus, where work earns the breaks. Compare more in the best website blockers for Chrome.
Cold Turkey from getcoldturkey.com, checked 29 October 2026. Trademarks belong to their owners, and Onus isn't affiliated with any of them.
Questions
How do I block a website on Windows without software?
Edit the hosts file as an administrator and add a line like 0.0.0.0 youtube.com for each address, then run ipconfig /flushdns. It blocks the site in every browser, for free.
Why is my hosts file block not working?
Usually the www. address is missing, the file was saved as hosts.txt, or the browser still has the old address cached. Add both addresses, save without an extension, run ipconfig /flushdns and restart the browser.
Can I block websites on Windows only at certain times?
Not with the hosts file. Family Safety has schedules for child accounts, and apps like Cold Turkey, Freedom and Onus can block on a schedule. Onus calls them sealed hours.
Is there a free website blocker for Windows?
The hosts file and Family Safety are free and built in. Cold Turkey has a free version, and Onus has a free plan with 2 sealed sites in Chrome or Edge.
More guides: every Onus guide in one place.
More: YouTube blocker · Reddit blocker · Blocker for studying · Onus vs Cold Turkey · Onus vs StayFocusd · Onus vs LeechBlock · How to stop watching YouTube · How to stop doomscrolling · Onus vs Freedom · Onus vs BlockSite · Opal alternative for computers · How to block YouTube Shorts · Blocker for ADHD · Block sites during work hours · Blocker for employees · Stop procrastinating · How to block TikTok · Block Instagram on Android · Push-up app blocker · Block YouTube on Android · Block Snapchat on Android · App blocker for Android · Use your phone less · Screen time calculator · Block a website on Chrome · Block a website on Edge · Best website blockers for Chrome · SelfControl for Windows · Block websites on a Mac · Block websites on a Chromebook · The research behind Onus · Cold Turkey vs Freedom · LeechBlock vs StayFocusd · BlockSite vs StayFocusd · Freedom vs Opal · Cold Turkey vs LeechBlock · Press kit · Block apps on Windows · Block games on a PC · Block websites on Android · Limit time on websites · Blocker with a timer · Pomodoro website blocker · Block websites at night · Stop binge-watching · Quit Reddit · All guides