Nikhil @gyaani Blog

Nerdy, tech loving , sports enthusiast, PHP freelancer.

Post Tags:
windows internet

Block Websites with password on Windows with Hosts file. No extra Software

Self control. Make difficult for self to open time wasting websites. No external software. Works on window 7 8 10

We will use hosts file to block websites. Then we will edit windows permissions so that the current user cannot edit the hosts file.

Method Overview

Now the hosts file can not be edited (easily).


+ Create User: Control panel > Users > Create user 'extraadmin'
+ Sing in to 'extraadmin': CTRL+ALT+DEL > "Switch User" > extraadmin
+ Edit hosts file: Win+R > Type : "notepad C:\Windows\System32\drivers\etc\hosts" > 'Enter'      localhost  
 ::1            localhost  

+ Remove DNScache: Win+R > Type: "ipconfig /dnsflush" . Screen should flash.
+ Set Permission of hosts file: Win+R > Type: "C:\Windows\System32\drivers\etc\" > Enter > Right click hosts > properties > security tab > edit > Click your user > Set write permission to Deny > ok
+ Set password on extraadmin: Control panel > Users > set password > Set a really long password that would be tedious to type:
"I really should not go to this website" > ok

Sign out > log back in normal account. Done!

Forgot password ?

Password of new admin user can be edited by another admin user easily.