Block website on Windows without host file
Solution 1
Why don't you just change the permissions on the hosts file so that "Everyone" or "Authenticated Users" have modify? Then anyone can edit it. Though, I am confused as to why you would ever do this.
Solution 2
You could use Fiddler with the following bit of fiddlerscript. You can add them in Rules > Customize Rules…
and put it under the OnBeforeRequest
function:
if (oSession.HostnameIs("subdomain.example.com")){
oSession.bypassGateway = true;
oSession["x-overrideHost"] = "127.0.0.1";
}
This would cause your browser to search for a website on localhost rather than subdomain.example.com. This script simulates the Windows hosts file.
Solution 3
You can use "Block content" in Opera or AdBlock in FireFox.
Related videos on Youtube
![Giorgi](https://i.stack.imgur.com/rBCMx.jpg?s=256&g=1)
Giorgi
Software Engineer Author of EntityFramework.Exceptions and LINQPad QueryPlan Visualizer Personal Blog & Portfolio
Updated on September 17, 2022Comments
-
Giorgi almost 2 years
Is it possible to block website on Windows without modifying hosts files? The reason I do not want to use it is that users need administrator options to modify it.
I need some easier way to block a website. Any ideas?
-
petersohn about 14 yearsSo you want a way to block websites that users without administrator rights can configure?
-
Giorgi about 14 yearsI want a user which does not have administrator rights to be able to block webpages for himself only.
-
Jeff Martin about 14 yearswhat is the purpose of a user blocking a webpage for himself, can't he just not go there?
-
nhinkle about 14 yearsI'm not sure why you want to let users block things for themselves when they could just not visit the site, but if you just want to block it in the browser, check out firefox addons like leech block, or find something equivalent for your browser. That may serve the desired purpose.
-
-
Nathaniel about 14 yearsIt would only block sites for your whole LAN if you specified it as the DNS server in your DHCP server (like your router). If you just set your computer to use it, only your computer will be affected.