Website and ad filtering

Let me first start out by saying that if you are looking for a good freeware Web filter for parental controls then I highly suggest checking out Best free Parental Filters. However, if you are looking to do some simple webpage and ad blocking yourself, then read on.

 

If you are running Windows 2000 and higher, navigate to your windows directory. From there go to System32\Drivers\ETC. This is the location of a file called hosts. The hosts file can be opened using Notepad.

 

So, what is the Hosts file anyway? The hosts file is first file by default that your computer looks to for name resolution. Name resolution is what tells us that Xtremediy.net belongs to a certain IP address. For example, lets say Xtremediy.net has an address of 192.168.153.229. Name resolution basically translates the 192.168.153.229 to Xtremediy.net so that we don’t have to remember that number to type into the web address.

 

I’m not going any further in depth with name resolution at this time. Lets focus on the Hosts file now. The hosts file can do name resolution for you as stated above. You can put in some of your favorite sites, and allow them to come up slightly faster because they don’t have to query internet resolution servers. Of course if the website ever has a change in IP address, you won’t be able to access it.

 

So what does a host file entry look like? Well, lets go back to my example of the Xtremediy.net IP address. If I put that address into the hosts file, then it wouldn’t have to query the internet DNS servers to find Xtremediy.net. Please note, that the IP address used in these examples is not the actual address to Xtremediy.net.

Below is the entry example:

192.168.153.229     xtremediy.net

 

That’s it! Enter the web address, press spacebar or tab, enter in the website name then press enter. On the next line you can continue with another address if you want.

 

So how can I use this to block websites and ads? The answer is already stated above. If the incorrect IP is entered for a site you will not get to that site. You will be directed to a different site. That information is more for a practical joke I suppose. So what about just blocking sites and ads? Well, you do this by using the IP address of 127.0.0.1, also known as the loopback address. This address points right back to your computer, so any sites you have pointing to the loopback won’t go anywhere.

 

The downside to the hosts file blocking method is that it does not allow wildcards.

 For example:

If I want to block my child from going to www.myspace.com I would enter the following into my hosts file.

127.0.0.1     www.myspace.com

 

If my child went to profile.myspace.com then they could bypass the filter.

 

If you intend to block sites from your children, I really suggest checking out the link at the beginning of the article. For more information about the hosts file, check out http://www.mvps.org/winhelp2002/hosts.htm.

Comments are closed.