Have you ever been in this situation? You attempt to block some websites with your hosts file and then you fire up your web browser and find that it is not working. The most common cause of this issue, in the past, was not formatting the hosts file correctly and this could still be true.
However: the adoption of DNS over HTTPS (DoH) as a privacy standard in web browser appears to be affecting the efficacy of the hosts file. This problem had affected me.
Fortunately, if you are a Firefox user, there is a workaround that does not involve simply disabling DoH. The workaround was actually specified in this Mozilla Support article but for some reason was difficult to find. Basically, what you do, is you change the provider for DoH to use-application-dns.net. If you are curious what that domain leads to, you can click on it and figure out that it is something provided by Mozilla for our collective benefit. It’s a nice little service they have.
Here’s how you change your DoH settings in Firefox:


Click on Settings…

You want to change your DNS over HTTPS provider to “Custom” and to enter the domain that Mozilla suggests if you want to re-enable use of your hosts file while continuing to use HTTPS over DNS (DoH).