Who is the block for? A child with their own Microsoft account, everyone who uses one Windows 10 PC, or every device in your home? That answer decides the method. For a child, use Microsoft Family Safety content filters in Edge. For one PC, add lines to the Hosts file as an administrator. For the whole network, filter at the router or DNS level. Each method below ends with how to check it and how to undo it.
Before you start: Windows 10 support and admin rights
Windows 10 support ended on October 14, 2025, so the PC no longer receives regular security updates. A website block is not a substitute for those updates: it stops a browser from reaching named sites, but it doesn’t protect an unpatched PC from other threats. Microsoft still lists Windows 10 among the devices Family Safety web filtering applies to.
You also need the right account. Editing the Hosts file requires administrator rights on the PC, and Family Safety content filters are managed by a family organizer. On a work or school computer, ask IT before changing anything, because those PCs are usually managed centrally.
Pick the method that matches the situation
- A child or other family member: Microsoft Family Safety. The filter is tied to the person’s Microsoft account, and Microsoft lists Windows 10, Windows 11 and Xbox One among the devices it applies to. It filters in Edge only and blocks other browsers while filtering is on.
- Everyone on one PC: the Hosts file. Every browser on that computer is affected, for every user. Anyone with administrator rights can undo it, so treat it as a convenience rather than a lock.
- Every device in the home: your router’s filtering or a filtering DNS service. Phones, consoles and laptops are covered without touching each device.
- A managed office PC: an Edge policy set by the administrator, covered near the end.
An example: Priya wants her son Alex’s laptop to skip a gaming site, and Alex signs in with his own Microsoft account. Family Safety is the right tool. Jordan, who shares one family PC with no separate child accounts, only wants a distracting news site gone for everybody; the Hosts file is quicker.
Block websites for a family member with Microsoft Family Safety
The family member needs a Microsoft account that is part of your family group and must sign in to Windows with it. If they don’t have one yet, Windows 10 usually offers Add a family member under Settings > Accounts > Family & other users.
- Sign in to Microsoft Family Safety on the web with the organizer account and choose Family Safety from the left menu if it isn’t already open.
- Find the family member, select the more options icon on their card and choose Go to overview.
- On the overview, select Edge as the platform.
- Turn on Filter inappropriate websites and searches. This also limits browsing to Edge, because Edge is the only browser Family Safety filtering supports.
- Under Blocked sites, enter the address you want to block, such as
example.com, and add it. Repeat for each site. - For a stricter setup, turn on Only use allowed websites and list approved sites under Allowed sites. Leave Always allow educational websites on if school sites should stay reachable.
Warning: once filtering is on, other browsers such as Chrome or Firefox are blocked on the child’s devices. You can manually unblock a browser, but anything the child opens in that browser is no longer filtered. Microsoft’s website filtering instructions for Family Safety describe this trade-off.
From a phone, open the Family Safety app, select the family member and choose Content filters to reach the same lists.
Check it and undo it
Sign in to the PC as the family member, not as yourself, open Edge and visit the blocked site. Then visit an unrelated site that should still work. Checking from the organizer’s account proves nothing, because the filter is set on the family member’s account, not yours. To undo a block, remove the site from Blocked sites; to stop filtering entirely, turn off Filter inappropriate websites and searches.
Block websites for everyone on one PC with the Hosts file
The Hosts file is a small text file Windows checks when it looks up a website name. If you point a name at 127.0.0.1, the PC’s own loopback address, browsers on that computer try to reach the site on the PC itself, and the real site doesn’t load. It works in every browser on the PC but does nothing for phones or other computers.
Back up the file first
- Open File Explorer and go to
C:\Windows\System32\drivers\etc. - Copy the file named hosts (it has no extension) and paste the copy somewhere outside that folder, such as Documents. If an edit goes wrong, you can compare against or restore this copy.
Add the block
- Open Start, type Notepad, right-click it and choose Run as administrator. Approve the prompt. Without this step Notepad can open the file but won’t be allowed to save it.
- In Notepad choose File > Open, go to
C:\Windows\System32\drivers\etc, change the file type filter from Text Documents to All Files and open hosts. - Go to the end of the file. Leave the existing lines alone; lines starting with
#are comments. - Add one line per name you want to block, with the address, a space or tab, and the name. To block example.com, add both forms:
127.0.0.1 example.com
127.0.0.1 www.example.com
- Choose File > Save. The file must stay named hosts, not hosts.txt.
- Open Command Prompt and run
ipconfig /flushdns, which Microsoft describes as flushing and resetting the DNS client resolver cache. Then close every browser window and reopen the browser.
Type names only: no https://, no slashes and no page paths. A Hosts entry can’t block one page while allowing another page on the same site. Each name is separate, so example.com doesn’t cover www.example.com or a mobile version such as m.example.com; list every name you see in the address bar.
Check it
Open the blocked name and the www version in a new browser window; both should fail to load. Then open an unrelated site as a control. If the control also fails, reopen the file and look for a line you changed by accident. If the site still loads from a phone or another PC, that’s expected: the Hosts file only affects this computer.
If the site still loads or the file won’t save
- “Access denied” or Save As appears: Notepad isn’t running as administrator. Close it and start again from step 1.
- The file became hosts.txt: turn on File name extensions on the View tab in File Explorer to see the real name, then rename it to hosts (no extension).
- Only one form is blocked: add the missing www or other subdomain line.
- The line has https:// or a slash: remove everything except the bare name.
- Old pages still appear: run
ipconfig /flushdnsagain and fully close the browser, or try a private window. - Security software complains: some security tools may warn about Hosts file changes. Confirm the change was yours before allowing it.
Undo the Hosts block
Open Notepad as administrator again, open the hosts file, delete only the lines you added and save. Run ipconfig /flushdns and restart the browser. Restore your backup copy only if you are sure nobody added other entries since you made it. The PowerToys Hosts File Editor is a Microsoft alternative to Notepad: it also needs administrator rights and backs up the file before it edits.
Block websites for every device on your network
When phones, tablets and consoles need the same rules, set them once at the network level. Many routers include website or parental filtering in their admin page, and some DNS services offer filtering that blocks categories of sites. Check your router maker’s documentation for the exact menu, since every model differs.
If you use a filtering DNS service on a single PC instead of the router, changing the DNS server on Windows 10 shows where to enter its addresses. Note that switching to an ordinary public DNS server does not block anything by itself; the filtering comes from the service you choose.
Office PCs: block sites in Edge with a policy
On computers an organization manages, administrators can use the Edge policy Block access to a list of URLs (policy name URLBlocklist, stored under SOFTWARE\Policies\Microsoft\Edge\URLBlocklist). Entries can be a whole domain such as contoso.com or a specific path, and Microsoft limits the list to 1,000 entries. Microsoft’s URLBlocklist policy reference explains the formats. To undo it, remove the entry from the policy list. On a work PC, this is IT’s job, not something to change yourself.
Why not Windows Defender Firewall or a browser extension?
Microsoft’s Windows Firewall rules documentation describes rules in terms of IP addresses, subnets and ranges rather than website names. Large sites can share addresses with others and change them over time, so an address-based rule can miss the site or block unrelated ones. For a website block, the methods above are more predictable.
Browser extensions that block sites exist for Chrome, Edge and Firefox, but they only affect the one browser profile they’re installed in, and anyone who can open another browser can get around them. They suit self-control for your own browsing more than restrictions for someone else.
Blocking sites: quick answers
Does the Hosts file block a site in Chrome and Firefox too?
Yes. It works at the Windows level, so every browser on that PC is affected for every user account. It does not follow anyone to another device.
Can a child get around Family Safety by installing another browser?
While filtering is on, Family Safety blocks unsupported browsers. If you manually unblock one, browsing in it is not filtered.
Can I allow only a short list of sites?
With Family Safety, yes: turn on Only use allowed websites and add each approved site. The Hosts file can’t do this, because it only lists names to redirect.
Should I use 127.0.0.1 or another address in the Hosts file?
Use 127.0.0.1, the loopback address shown above. If the PC runs a local web server, that server may answer instead of an error page, which is harmless but can look confusing.
Can a standard user remove a Hosts block?
Not without administrator approval, since saving the file needs admin rights. Anyone who knows an administrator password can, so give children standard accounts and keep a separate administrator account for yourself.
Start with the scope list near the top, set up one method, and check it from the account or device it’s meant to affect. If the goal is protecting a child, look through the rest of the Family Safety settings for that family member while you’re signed in.
Tim Williams runs Everything Tech, where he writes and reviews plain-English guides for Windows, Office and web browsers, checking each one against the software maker’s own documentation. He has 12 years of experience in IT support and five years of experience writing online tutorials.