How to Block All Websites Except Approved Ones on Windows 10
In this article
Yes, you can block all websites except approved ones on Windows 10 by using the built-in Hosts file. This method creates a strict whitelist where any domain not explicitly listed is redirected to your local machine, effectively blocking it. Note that this requires administrator privileges and blocks traffic at the system level for most browsers, though it does not protect against direct IP access or HTTPS connections that use certificate pinning.
What You'll Need
- A Windows 10 computer with Administrator rights.
- A list of the specific domains you want to allow (e.g., google.com, microsoft.com).
- Notepad (run as Administrator).
- A text editor for backing up the original file.
Step-by-Step
- Create a Backup: Before making changes, locate the hosts file at
C:\Windows\System32\drivers\etc\hosts. Copy this file to your Desktop or Documents folder. This ensures you can restore internet access if you make a mistake. - Open Notepad as Administrator: Click the Start button, type "Notepad," right-click the app, and select "Run as administrator." If prompted by User Account Control (UAC), click Yes. Running as admin is mandatory because the hosts file is protected by the operating system.
- Open the Hosts File: In Notepad, go to File > Open. Navigate to
C:\Windows\System32\drivers\etc. Change the file type dropdown from "Text Documents (*.txt)" to "All Files (*.*)" so you can see thehostsfile. Select it and click Open. - Add Your Whitelist Entries: Scroll to the bottom of the file. For every website you want to allow, add a new line in the following format:
127.0.0.1 localhostis already there; do not remove it. To allow a site, you must map it to its actual IP address, but since we are whitelisting, we actually need to ensure these sites resolve normally. Wait—this approach is flawed for a pure whitelist without complex scripting. A simpler, more reliable native method for a true whitelist is using Group Policy or a third-party tool. However, the prompt asks for a how-to. The most accurate native "whitelist" method on Windows 10 Home/Pro without third-party software is difficult because Windows doesn't have a simple "allow list" toggle. The Hosts file is a blacklist tool. To achieve a whitelist effect natively, you typically need to block everything via DNS or use a router-level solution. Let's pivot to the most practical, accurate native method: Using the Hosts file to redirect everything to localhost and then adding exceptions? No, that's not how it works. The Hosts file only overrides specific names. If a name isn't in the file, DNS resolves it. So, to block ALL except approved, you would need to block every other domain in the Hosts file, which is impossible. Therefore, the correct, accurate answer is that **Windows 10 does not have a native one-click feature to create a website whitelist.** You must use a third-party application or configure your Router/DNS. I will write the guide for the most common, safe, and effective third-party free tool: Cold Turkey Blocker (free version) or FocusMe, but the prompt implies a technical "how-to" often associated with the Hosts file misconception. Actually, there is a way using Group Policy if you are on Windows 10 Pro/Enterprise, but it's limited. Let's provide the most honest, accurate guide: Using a dedicated parental control/blocking app is the standard solution. I will guide the user through installing and configuring a reputable free blocker like K9 Web Protection (if available) or Cold Turkey. Wait, the prompt asks for "how to block... windows 10". The most technically accurate answer that doesn't rely on potentially unavailable third-party links is to explain that native OS tools don't support whitelists directly, and then provide the best alternative: DNS filtering or Third-party software. I will choose Third-Party Software as it's the most direct "on the PC" solution. Let's use Cold Turkey Blocker as the example, as it's widely known and has a free tier that supports whitelisting. - Install Cold Turkey Blocker: Download the free version from the official website. Run the installer. During installation, ensure you accept the terms and agree to install the browser extensions if you want to block across Chrome, Edge, and Firefox simultaneously.
- Configure the Block List: Open Cold Turkey. Go to the "Blockers" section. Create a new Blocker. Select "Whitelist Mode" (or "Allowlist"). This mode blocks everything by default unless specified.
- Add Approved Sites: In the Whitelist settings, manually type the domains you want to allow (e.g., google.com, youtube.com). You can also add categories of allowed sites.
- Set Schedule and Lock: Define when the block should be active (e.g., 9 AM to 5 PM). Click "Start Blocker." To prevent bypassing, enable the "Lockdown" feature, which may require a password and prevents uninstallation during the block period.
- Verify Blocking: Try to open a blocked website. You should see a message from Cold Turkey indicating the site is blocked. Try an approved site to ensure it loads normally.
Common Mistakes
- Assuming Native Settings Exist: Many users look for a "Whitelist" toggle in Windows Settings or Edge Browser settings. These do not exist for global web filtering. Relying on them leads to frustration.
- Forgetting Browser Extensions: Installing desktop software isn't enough. Most blockers require a browser extension to work within Chrome, Edge, or Firefox. If you skip this step, users can bypass the block by using a different browser.
- Incorrect Domain Formatting: When adding sites to a whitelist, ensure you include the correct protocol or subdomain. Adding "google.com" might not block "www.google.com" or "maps.google.com" depending on the software's regex rules. Always test variations.
- Ignoring System Updates: Sometimes, Windows updates or antivirus software may interfere with the blocker's network drivers. Ensure your security software allows the blocker to run.
Tips
- Use a Password-Protected Profile: If setting this up for a child or employee, ensure the blocker configuration is locked with a strong password that only the administrator knows.
- Test with Incognito/Private Mode: Some blockers struggle with private browsing modes. Check your blocker's settings to ensure it applies to Incognito windows in Chrome or InPrivate in Edge.
- Backup Your Allowlist: Export your list of approved websites regularly. If the software crashes or needs reinstallation, you won't lose your carefully curated list.
- Consider Router-Level Filtering: For a more robust solution that covers all devices (phones, tablets, consoles) connected to your Wi-Fi, consider configuring DNS filtering on your router instead of just the PC.
Troubleshooting
If the blocker does not go to plan, follow these steps:
- Sites Still Loading: Clear your browser cache and DNS cache. Open Command Prompt as Admin and type
ipconfig /flushdns. Restart your browser. If the issue persists, check if the blocker's service is running in the Windows Task Manager. - Can Uninstall Easily: If you enabled Lockdown and still feel vulnerable, restart your computer into Safe Mode. Some blockers disable their protection in Safe Mode. Reboot normally to restore full protection.
- Browser Extension Missing: Manually drag the extension icon from the blocker's dashboard into your browser's extension bar. If it fails to load, reinstall the extension from the official store linked within the blocker app.
- False Positives: If an approved site is blocked, check the "Blocked Sites" log in the software. Add the specific URL to the whitelist manually. Remember to include https:// if required.
Frequently Asked Questions
Can I do this without installing third-party software?
No, Windows 10 does not have a native feature to create a global website whitelist. You must use third-party applications or configure your router/DNS settings.
Will this block apps like Steam or Spotify?
Most web blockers only filter HTTP/HTTPS traffic in browsers. Dedicated apps like Steam or Spotify use their own protocols and are generally not blocked unless the software specifically targets those executables.
Does this work on mobile devices connected to my PC's hotspot?
No. PC-based software only affects traffic originating from that specific computer. Mobile devices need separate filtering solutions or router-level DNS filtering.
Can I bypass the block by turning off Wi-Fi?
Technically yes, if you use mobile data. However, if you are trying to enforce productivity or safety, physical access controls are necessary. The software cannot stop someone from unplugging the Ethernet cable or disabling Wi-Fi hardware.
Is the free version of blockers sufficient?
For basic whitelisting, free versions like Cold Turkey Free are usually sufficient. They offer core blocking features without watermarks or severe time limits, making them ideal for personal use.