Windows 10 includes built-in tools to restrict access to distracting or harmful websites. Learning how to block websites on Windows 10 can help you stay focused at work or protect your kids from inappropriate content. You don’t need third-party software to get started—Microsoft’s operating system offers several free methods that work right out of the box.
This guide walks you through every reliable way to block websites on a Windows 10 PC. We cover the Hosts file method, using the Windows Firewall, setting up Family Safety, and tweaking your router settings. Each method has its own strengths, so you can pick the one that fits your needs best.
How To Block Websites On Windows 10 Using The Hosts File
The Hosts file is a simple text file that maps domain names to IP addresses. By redirecting a website’s address to your local machine (127.0.0.1), you effectively block it. This method works across all browsers and doesn’t require any extra software.
Step-By-Step Guide To Edit The Hosts File
Editing the Hosts file is straightforward, but you need administrator privileges. Follow these steps carefully:
- Press Windows Key + R to open the Run dialog box.
- Type
notepadand press Ctrl + Shift + Enter to open Notepad as administrator. - In Notepad, click File > Open.
- Navigate to
C:\Windows\System32\drivers\etc. - Change the file type filter from “Text Documents (*.txt)” to “All Files (*.*)”.
- Select the hosts file (no extension) and click Open.
- Scroll to the bottom of the file.
- Add a new line for each website you want to block. For example:
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com - Save the file by pressing Ctrl + S.
- Close Notepad and restart your browser for changes to take effect.
Thats it. The websites you added will now redirect to your local machine, which shows a blank page or an error. To unblock a site, simply remove the line you added from the Hosts file and save again.
Common Mistakes When Using The Hosts File
People often forget to include both the “www” version and the root domain. For example, blocking only www.youtube.com leaves youtube.com accessible. Add both entries to ensure full blockage.
Another issue is not running Notepad as administrator. If you skip that step, Windows won’t let you save changes to the Hosts file. Always use Ctrl + Shift + Enter to open with admin rights.
Block Websites Using Windows Firewall
The Windows Firewall can block outbound traffic to specific IP addresses. This method is more technical but very effective. It prevents any program on your PC from reaching the blocked site, not just web browsers.
How To Find A Website’s IP Address
Before you can block a site via the firewall, you need its IP address. Use the ping command to find it:
- Open Command Prompt by typing cmd in the Start menu and pressing Enter.
- Type
ping www.example.comand press Enter. - Look for the line that says “Reply from [IP address]”.
- Write down that IP address. Note that some large sites like Google or Facebook use multiple IPs, so you may need to block several.
Creating A Firewall Outbound Rule
Once you have the IP address, follow these steps to block it:
- Press Windows Key + R, type
wf.msc, and press Enter. - In the left pane, click Outbound Rules.
- In the right pane, click New Rule….
- Select Custom and click Next.
- Leave “All programs” selected and click Next.
- Under “Which remote IP addresses does this rule apply to?”, select These IP addresses.
- Click Add, enter the IP address of the website, and click OK.
- Click Next.
- Select Block the connection and click Next.
- Check all three profiles (Domain, Private, Public) and click Next.
- Give the rule a name like “Block Facebook” and click Finish.
This rule blocks all traffic to that IP address. To unblock, go back to Outbound Rules, find your rule, right-click it, and select Disable or Delete.
One downside: if the website changes its IP address, your rule stops working. You’d need to update the rule with the new IP. Also, this method doesn’t work well for sites that use content delivery networks (CDNs) with many IPs.
Using Microsoft Family Safety To Block Websites
Microsoft Family Safety is a free parental control feature built into Windows 10. It lets you block specific websites, set screen time limits, and monitor activity. This method is ideal for parents who want to protect children.
Setting Up Family Safety
First, you need a Microsoft account for yourself and one for each child. Follow these steps:
- Go to Settings > Accounts > Family & other users.
- Click Add a family member.
- Enter your child’s email address or create a new one.
- Select Child and click Confirm.
- Your child will receive an invitation to join your family group. Accept it on their device.
Blocking Websites Through Family Safety
Once the child account is set up, you can manage website restrictions online:
- Go to account.microsoft.com/family and sign in with your parent account.
- Select your child’s name.
- Click Content filters.
- Under “Web browsing”, toggle Block inappropriate websites to On.
- In the “Always blocked” section, click Add a site and type the URL you want to block.
- Click Save.
Family Safety blocks the site across all browsers on the child’s Windows 10 device. It also works on Xbox and Android devices signed in with the child’s account. You can view browsing activity reports to see what sites your child visits.
Limitations Of Family Safety
This method only works for child accounts, not for adult accounts. If you want to block sites for yourself, use the Hosts file or firewall method instead. Also, Family Safety requires both parent and child to have Microsoft accounts and be part of the same family group.
Block Websites At The Router Level
Blocking websites at the router level affects every device connected to your home network. This includes phones, tablets, gaming consoles, and smart TVs. It’s a powerful way to enforce restrictions across your entire household.
Accessing Your Router Settings
Every router has a different interface, but the general steps are similar:
- Find your router’s IP address. Common ones are
192.168.1.1or192.168.0.1. - Open a web browser and type that IP address in the address bar.
- Enter your router’s admin username and password. If you haven’t changed them, check the sticker on the router or the manual.
- Look for a section called Access Control, Parental Controls, Security, or Firewall.
- Find the option to block specific websites or URLs.
- Enter the domain names you want to block (e.g.,
facebook.com). - Save the settings and reboot the router if prompted.
Some routers let you block by keyword, so you can block all URLs containing “game” or “social”. Others allow scheduling, so you can block sites only during homework hours.
Pros And Cons Of Router-Level Blocking
The biggest advantage is that it blocks sites on all devices without installing anything. It’s also harder for tech-savvy kids to bypass. However, it requires access to the router admin panel, which not everyone has. Also, if you’re using a public or school network, you can’t control the router.
Another drawback: router interfaces vary widely. If you can’t find the blocking option, consult your router’s manual or the manufacturer’s website. Some modern routers have mobile apps that make this easier.
Using Third-Party Software As An Alternative
While built-in methods are free and effective, some users prefer dedicated software for extra features. Programs like Cold Turkey, Freedom, or FocusMe offer scheduling, whitelisting, and cross-device syncing. They are especially useful for blocking distractions during work hours.
When To Consider Third-Party Tools
Consider third-party software if:
- You need to block sites on a schedule (e.g., only during work hours).
- You want to block by category (e.g., all social media, not just specific URLs).
- You need to block sites across multiple browsers and devices.
- You want to make it very difficult to bypass the blocks (some tools use kernel-level blocking).
Most third-party tools offer free trials, so you can test them before buying. Keep in mind that they run in the background and may use system resources.
How To Block Websites On Windows 10 For Specific Browsers
If you only use one browser, you can block sites using browser extensions. This is the easiest method but also the easiest to bypass—someone can simply use a different browser.
Using Browser Extensions
For Google Chrome, extensions like BlockSite or StayFocusd let you block websites with a few clicks. Here’s how to use BlockSite:
- Open Chrome and go to the Chrome Web Store.
- Search for “BlockSite” and click Add to Chrome.
- Click the extension icon in the toolbar.
- Enter the URL you want to block and click Add.
- Optionally, set a schedule for when the block is active.
For Firefox, similar extensions like LeechBlock or BlockSite are available. Microsoft Edge also supports Chrome extensions, so you can use BlockSite there too.
Limitations Of Browser Extensions
Browser extensions only work in the browser where they are installed. If someone uses a different browser or incognito mode, the block is bypassed. They are best for light, self-imposed restrictions rather than strict parental controls.
Frequently Asked Questions
Can I block websites on Windows 10 without admin rights?
No, most methods require administrator privileges. The Hosts file, firewall, and Family Safety all need admin access. If you don’t have admin rights, you can use browser extensions, but they are easier to bypass.
Will blocking a website via the Hosts file affect all users?
Yes, the Hosts file is system-wide, so it blocks the site for every user on that PC. This includes all browsers and even some non-browser apps that try to connect to that domain.
How do I unblock a website on Windows 10?
To unblock, reverse the method you used. For the Hosts file, remove the line you added. For the firewall, disable or delete the rule. For Family Safety, remove the site from the blocked list. For router blocking, delete the URL from the access control list.
Does Windows 10 have a built-in website blocker?
Windows 10 does not have a single “block website” button, but it includes several tools that can block websites: the Hosts file, Windows Firewall, and Microsoft Family Safety. Each works differently, so choose based on your needs.
Can I block websites on Windows 10 using Command Prompt?
Yes, you can edit the Hosts file using Command Prompt with administrator privileges. Type notepad C:\Windows\System32\drivers\etc\hosts in an admin Command Prompt to open the file. You can also use the echo command to add entries, but it’s easier to use Notepad.
Final Thoughts On Blocking Websites In Windows 10
You now have several reliable methods to block websites on Windows 10. The Hosts file is quick and works everywhere. The firewall method is more robust but requires finding IP addresses. Family Safety is perfect for parents. Router-level blocking covers all devices in your home. And browser extensions offer a simple, lightweight option.
Pick the method that matches your technical comfort and your specific need. For most people, the Hosts file offers the best balance of simplicity and effectiveness. If you need more control, combine multiple methods—for example, use the Hosts file for yourself and Family Safety for your children.
Remember to test each block after setting it up. Open a browser and try to visit the blocked site. If it still loads, double-check your entries or rule settings. A small typo in the Hosts file can break the block entirely.
With these tools, you can take control of your browsing experience and create a safer, more productive digital environment on your Windows 10 PC.