Blocking websites on Windows 10 can help you stay focused, keep children away from inappropriate content, or prevent yourself from wasting time on distracting sites. This guide covers five practical methods—from using the hosts file to configuring DNS filters—so you can choose the one that fits your technical comfort and needs. No special software is required for most methods, and all steps are reversible.
What You’ll Need
- A Windows 10 PC with administrator account access.
- The exact website addresses you want to block (e.g., www.facebook.com).
- For some methods, a router login password (if you want to block across your whole network).
Step-by-Step
Method 1: Using the Hosts File (Simple, PC-only)
- Press Windows + R, type
notepad, and press Enter. Right-click the Notepad icon in the taskbar and select Run as administrator. - In Notepad, go to File > Open. Navigate to
C:\Windows\System32\drivers\etc. Change the file filter from “Text Documents” to All Files. - Select the file named hosts and click Open.
- At the bottom of the file, add a new line for each site you want to block. Use the format:
127.0.0.1 www.example.com(replace with the actual site). For example, to block Facebook, add:127.0.0.1 www.facebook.comand also127.0.0.1 facebook.com. - Save the file (Ctrl+S). If you see a permission error, make sure Notepad is running as administrator and the file is not read-only.
- Flush the DNS cache by opening Command Prompt as administrator and typing
ipconfig /flushdnsthen press Enter. - Test by opening a browser and navigating to the blocked site. You should see an error or a blank page.
Method 2: Using Windows Parental Controls (Family Safety)
- Open Settings (Windows + I) and click Accounts.
- Go to Family & other users and click Add a family member. Create a child account if you don’t have one, or add an existing child account.
- Once the child account is added, open a web browser and go to account.microsoft.com/family. Sign in with the parent Microsoft account.
- Click Content filters for the child account.
- Under Web browsing, toggle on “Block inappropriate websites.” Then, under Always blocked, click Add a website and enter the domain (e.g.,
facebook.com). - Repeat for each site you want to block. Changes take effect within a few minutes.
Method 3: Using a Third-Party DNS Service (OpenDNS)
- Sign up for a free account at OpenDNS (opendns.com).
- In your OpenDNS dashboard, add your home network’s public IP address. If your IP is dynamic, download and install their Dynamic IP updater tool.
- In the OpenDNS dashboard, go to Web Content Filtering and choose a filtering level (e.g., “High” to block adult content). You can also add specific domains to a block list under Manage Individual Domains.
- On your Windows 10 PC, go to Control Panel > Network and Internet > Network and Sharing Center > Change adapter settings.
- Right-click your active network connection (Wi-Fi or Ethernet) and select Properties.
- Select Internet Protocol Version 4 (TCP/IPv4) and click Properties.
- Choose Use the following DNS server addresses and enter
208.67.222.222and208.67.220.220(OpenDNS’s servers). Click OK. - Flush DNS cache as in Method 1. The filter will now apply to all browsing on this PC.
Method 4: Blocking at the Router Level (Whole Network)
- Open a web browser and enter your router’s IP address (commonly 192.168.1.1 or 192.168.0.1). Log in with your router’s admin credentials.
- Look for a section named Security, Access Control, Parental Controls, or Website Filtering. The exact location varies by router brand.
- Find the option to Block websites or URL filtering. Enter the domain names you want to block (e.g.,
facebook.com). - Save the settings and reboot the router if prompted. This will block the sites for every device connected to your Wi-Fi.
Method 5: Using a Browser Extension (Chrome, Edge, Firefox)
- Open your browser and go to its extension store (Chrome Web Store, Edge Add-ons, or Firefox Add-ons).
- Search for a website blocker extension like “BlockSite” or “StayFocusd”. Install one with good ratings.
- Click the extension icon in the toolbar and open its settings.
- Add the websites you want to block. Some extensions allow scheduling (e.g., block during work hours).
- Enable the extension. It will block those sites in that browser only.
Common Mistakes
- Not running Notepad as administrator – you’ll get an “access denied” error when saving the hosts file.
- Blocking only the “www” version – many sites can be accessed without “www”, so block both variants.
- Forgetting to flush DNS – changes to the hosts file may not take effect until you flush the DNS cache.
- Using a browser extension on only one browser – if the user can switch to another browser, the block is bypassed.
- Blocking by IP address instead of domain – many sites share IP addresses with other sites, which can cause over-blocking.
Tips
- Use the hosts file method for a quick, system-wide block that doesn’t require additional software.
- For child safety, combine Windows Family Safety with a DNS filter like OpenDNS for redundancy.
- If you’re blocking distracting sites for yourself, consider a browser extension with scheduling so you can allow access during breaks.
- Keep a backup of your hosts file before editing, so you can restore it if needed.
- Test after each change to ensure the block works and that you haven’t accidentally blocked legitimate sites.
Troubleshooting
- Hosts file changes don’t work: Ensure you’ve edited the correct file (no extension) and that there are no leading spaces or typos. Also verify that the site isn’t using a different domain (e.g., m.facebook.com).
- Can’t save hosts file: Run Notepad as administrator, and check if the file is read-only (right-click > Properties > uncheck Read-only).
- Blocked site still loads: Clear your browser cache and flush DNS. If using a VPN or proxy, the block may be bypassed.
- Router settings not found: Check your router’s manual or look for “Access Restrictions” or “Firewall” sections. If your router doesn’t support URL filtering, consider using a DNS service instead.
- Family Safety not applying: Make sure the child account is signed in on the PC, and that the parent account has set up content filters. Changes can take up to 15 minutes.
Frequently Asked Questions
Can I block websites without admin rights?
No, most methods (hosts file, DNS settings, router) require administrator access. A browser extension might work without admin rights if you can install it, but it only affects that browser.
Will blocking a website on my PC affect other devices?
No, the hosts file and browser extensions only affect the specific PC. DNS settings also affect only the PC unless you configure the router.
Can I block a website for a specific time of day?
Yes, browser extensions like StayFocusd allow scheduling. Windows Family Safety also has time limits for device usage, but not per-website scheduling.
How do I unblock a website?
Simply reverse the steps: remove the line from the hosts file, delete the domain from the block list, or change DNS settings back to automatic.
Is it legal to block websites on my own computer?
Yes, blocking websites on your own device or network is legal. However, blocking access for others without their consent may raise privacy or policy concerns, especially in workplaces.
Can I block websites on Microsoft Edge specifically?
Yes, you can use a browser extension for Edge, or use the hosts file method which blocks all browsers. Edge also supports Family Safety settings.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Photonic Inference vs GPU Inference: Key Differences16,384.00 µs
- Android Low Storage Survival Tips That Actually Work
- How to Password Protect PDFs on iPhone
- iPhone Force Restart Not Working? Fixes
- Add or Remove Keyboard Layout in Windows 10
- Razer Barracuda V2 Pro Dongle: Store & Find