Thursday, July 22, 2010

Block and redirect websites using HOSTS file

I am sure after reading my previous post you all might be wondering about how to block websites using HOSTS file, or even how to redirect them? It would be so cool to type and see open infront of you!!! Excited then read on!

Navigate to C:\Windows\system32\drivers\etc\hosts in your windowsXP,Vista or 7. (if C is the windows directory)

As you might have all known by now that hosts file does not have an extension and so you might be wondering as to how to open it.To open the HOSTS file drag it into a notepad or rightclick>open with>notepad.. It will look like the image I have put in.

To block a website. Simply put     

Replace example with the website you desire. For e.g if you want to block facebook,myspace and orkut you need to type

Now save the file. You are done. Whenever you type these websites in your browser it will display an error "The page cannot be displayed".


If you want to redirect google to yahoo,you need to know the IP address of google. For this you need to type ping in command prompt. That will give you the IP address which is
Now in you hosts file you need to type

So whenever you type in your browser it will open

This can be used for hacking also. Think how???  :) :)