The hosts file, family safety, DNS settings and browser policies for a clean Windows setup.
The Windows hosts file maps domains to local addresses before the network is asked. Adding an adult domain there makes every program on the machine fail to reach it, with no software running and no account involved. The path is C:\Windows\System32\drivers\etc\hosts, and the file is protected, which is why the edit takes an administrator.
Open Notepad as administrator: press Start, type Notepad, right-click it, choose Run as administrator, then open the file from the path above. Append the lines from the hosts file generator, save, and the block is active immediately. Test one domain in a browser to confirm it fails to load.
One caveat worth knowing: a few browsers offer encrypted DNS, and if it is enabled the browser may resolve names itself and step around the file. If a blocked site still opens after the edit, check that setting first.
The hosts file generator on this site builds the file from your list, so the manual step is reduced to pasting the lines in. If you later want to remove a domain, delete its line and save; the block lifts with the file.
Family Safety is Microsoft's account-based filter. You add a family member account, apply web filtering from the Family Safety site, and the filter follows the account across Edge and Windows devices where the member is signed in. It is the right tool when the device is shared or supervised by someone else.
The filter works per account rather than per machine, so it does not replace the hosts file, it complements it. Together they cover the two cases: the machine blocks everyone who sits down, and the account filter follows the supervised person to other devices.
Family Safety also travels across devices where the member signs in, so the filter follows the account rather than staying on one machine. For a shared home PC, that is the difference between filtering the person and filtering the chair.
The third layer changes the DNS servers the network asks. A family DNS resolver refuses to answer for adult domains, which blocks them for every device on the network, phones and smart TVs included, with one setting on the router or on the Windows network adapter.
Public family resolvers exist for exactly this purpose, and both the router page and the Windows network settings have a DNS field ready for them. The trade-off is the same one as always: router-level covers everything at home but nothing once a device leaves the house, so it pairs naturally with the per-device layers above.
Set it on the router for the household and on the Windows network adapter for a single machine; both fields live in the network settings and both take under a minute. Test with one known domain afterwards.
Browsers bring their own switches. In-browser filters and safe search settings cover the browsing session, and they matter because they are the layer that works when the device is on someone else's network. The hosts file and the router DNS do nothing away from home; the browser settings travel with the profile.
The honest edge cases: encrypted DNS can walk around the hosts file, a VPN resolves names elsewhere entirely, and a determined user can edit the hosts file back. Layering is the answer to every one of these, because each layer fails in a different direction.
The browser layer also travels: safe search, extensions and profile settings follow the account, which makes it the layer that still works when the device is on someone else's network, the case the hosts file and the router DNS cannot cover.
After each layer, test one domain. A hosts edit that did not save, a DNS setting typed one digit wrong, a Family Safety filter applied to the wrong account: all three fail silently and look identical to success. One browser check per layer catches all of them in ten seconds.
Then set the removal cost honestly. The hosts file is the easiest layer to undo, so on a device you share or supervise, pair it with something that takes a second person or a passcode to remove. The goal of the stack is to put minutes between the urge and the reach, and every layer adds a few more.
A blocked attempt looks like a failed page load, and that failure is the stack working. If the urge ever asks whether the block is still there, one test domain answers it in ten seconds, and the answer is usually worth hearing.
Three layers: edit the hosts file at C:\Windows\System32\drivers\etc\hosts with the generated list, apply Microsoft Family Safety web filtering to the signed-in account, and set a family DNS resolver on the router or network adapter. Test one domain after each layer.
Yes, it only takes deleting the lines you added. That is why it works best as one layer of several: pair it with an account filter or a router DNS setting that takes more steps to remove.
Usually one of three things: the edit did not save, the browser has encrypted DNS enabled and resolves names itself, or a VPN is handling the connection. Check the file first, then the browser's secure DNS setting, then the VPN.
Yes. The generator builds the file for step one from your own list, and the other layers, Family Safety, router DNS and browser policies, stack on top of it. The stack is stronger with all of them than with any one.
The hosts file and the router DNS need no account at all. Family Safety uses the Microsoft account, and browser sync uses its own. The stack works either way; the account layers just travel with the person.