Block websites using HOSTS file in Windows

Block websites using HOSTS file in Windows

Here is a nice trick that you can use if you want to do some funs with your friends. This trick will block them from access any websites that you specify in the HOSTS file in Windows. But you only can do this trick if you can get access to his/her PC without he/she know. Let say when he/she leave the PC for awhile.
First thing that you need to do is to open HOSTS file which is located at
C:/windows/system32/drivers/etc
From 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

Popular posts from this blog

How to configure Glowroot with Liferay

How to Get Back Asus Zenphone 5 from Soft Brick

How to Unlock Boot Loader of Htc Explorer