| The internet is a great place to find a lot of great and free information. There is also a lot of not so good content or not appropriate content out there. Let say your kids or spouse keeps going out to a website that you don’t wan them to be viewing. In this article we will walk through the steps on how to redirect the traffic from the bad site to what ever site you want. (Note: In this example I am using a windows XP machine. There are a few more steps involved in changing this in Vista. I will cover this in a later article.) In this example I am going to redirect Yahoo.com to Google.com We are going to want to get the IP address of the site we are going to redirect the bad site to. So in this example I am going to redirect yahoo.com to google.com. I will need to find the IP address of google.com.
Go to your Start menu and select run Type cmd and hit ok
You should now see a black DOS window. Type the command ping google.com and hit enter You can swap out google.com with what ever site you want. You should now see what the IP address is. It should be 4 sets of numbers separated by “.”. So in this example it is 209.85.171.99. Right down this number. Next thing we will need to do is locate a file named host. This file can be found in C:\WINDOWS\system32\drivers\etc
You will need to open this file with notepad. Right click on it and select Open
You will need to select notepad from the list of applications and hit ok You should now see a file that looks like this.
We are now going to add an entry. You will want to add it just below the 127.0.0.1 entry. The first part will be the IP address of the website you are going to redirect to. So in this example it would be my Google’s IP address (209.85.171.99) The second part is the site name. This would be the bad site that you don’t want however visiting. In my example it is yahoo.com
Now that you have entered the redirect we will need to save the file and test it. If you have visited the bad site and have not closed your browser since then, you will need to close your browser and then open it for the changes to take effect. You can see here that I entered Yahoo.com and it sent me to google.com.
So how does this work. Most websites have a domain name associated with the IP of the server. When you type in the domain name (example: yahoo.com) it first goes and looks at your host file to see if the entry is in there. If it is not then it goes out to your internet provider to find the IP address of the domain name. Since we put an entry in here for that site it uses the IP address that you supplied. Please give us some feedback, let us know your thoughts about "How To Block A Specific Website with the Host File"!
|