BlockMyself
Script builder

Block a list of sites on a computer.

For Windows and Linux, where Apple's profiles do not exist, and for a Mac when you want a hosts-level list alongside the profile. Paste the sites you want blocked and this writes a script that adds them to the operating system's own hosts file, which a standard account cannot edit, then locks it so even an administrator has to take a deliberate extra step to change it back.

Runs in your browser Free, no account Survives browser DNS

What this is good at, and what it is not

Its real advantage

A hosts file is consulted before a browser's own encrypted DNS, so unlike DNS filtering it is not bypassed by turning on Secure DNS or switching resolver. That is the most common way people defeat a filter, and it does not work here. It also needs no account, works offline, and sends nothing to anyone.

Its real limit

There are no wildcards. Each line matches one exact hostname, so a site you block may still load on a subdomain you did not list. This is precise rather than comprehensive, which makes it excellent for a specific list of sites and a poor choice as your only layer.

The lock is the administrator password, not the file.

The script can make the file unwriteable, but an administrator can always undo that in a couple of commands. This only becomes a control if your daily account is a standard account and someone else holds the administrator password. If you are an administrator on your own machine, treat this as a speed bump you have chosen, which is still worth having.

Build your script

You will run this in PowerShell as an administrator.

One per line. Just the domain. The script adds both the bare domain and its www. form for you.

The second one matters if you also use a filtering DNS service, because a browser resolving names itself walks straight past it. It is not needed for the hosts file, which browsers respect either way. The Firefox policy it generates also disables Private Browsing and about:config; the Windows registry file only covers encrypted DNS.

What to pair this with