Block websites using HOSTS file in Windows
Block websites using HOSTS file in Windows
First thing that you need to do is to open HOSTS file which is located at
C:/windows/system32/drivers/etcFrom there, open up the HOSTS file with notepad and put the sites URL that you wish to block. For an example, I want to block www.yahoo.com. What I do is to put this line
127.0.0.1 www.yahoo.com
under the localhost like this:
127.0.0.1 localhost
127.0.0.1 www.yahoo.com
Now what? Ok now go to the internet browser and try go to www.yahoo.com by typing the URL at the address bar. What you will get is the browser is unable to connect to www.yahoo.com. This is because the DNS for www.yahoo.com has been changed to 127.0.0.1 instead of the original www.yahoo.com DNS which is 209.131.36.158.
Extra note: Based from my experience, a virus can edit your HOSTS file and make you unable to connect to the antivirus websites such as www.kaspersky.com, www.symantec.com, etc. This purpose of it is to prevent you from do the definition update. In case this thing happens, what you should do is just remove all those lines and you are able to connect to the websites as usual.
Comments
Post a Comment