|
Browsing the web can often be an experience of searching for content among advertisements and waiting for ads served up remotely from various domains. There is an easy [and free] way to eliminate many of these ads with the added benefit of speeding up the serving of web pages; the "HOSTS" file can be used as a tool to block these ads, and it can be customized by each user to suit their browsing habits. |
| The Hosts file shows the IP address [in the form of xxx.xxx.xxx.xxx] and name of various domains. Generally, if a domain has a constant IP address browsing is speeded up as Windows will consult the Hosts file first when translating domain names to IP addresses. In the Windows folder, there is a file named "Hosts.sam" [meaning sample] file. The sample file shows an example of an IP address with a domain name and directions on how to use a HOSTS file; the items which are preceded by the "#" sign are for explanation only. |
| There is an IP address reserved for all local computers [yours and mine] which is the same for everyone; that address is 127.0.0.1. Since Windows will look in the Hosts file first to translate a domain name to an IP address, if the domain names of advertisers are listed in your Hosts file with the IP address of 127.0.0.1, then Windows will, of course, not find the real IP address of the advertiser and no advertisement will be sent to you. When you browse to a web page which has ads from the domains listed in your Hosts file, the web page will show one to several blank spots where the ad would be and Windows won't miss them or wait for them. And, you, the surfer, will be served up content without the wait for and clutter of ads. |
|
|
|
1 - Find the Host.sam file in your Windows folder. [If the extension does not show, open Windows Explorer; on the Menu Bar,
select "Tools/Folder Options/View Tab". Uncheck "Hide file extensions for knowm file types."] 2 - Copy/paste it back into the Windows folder. 3 - Rename the "copy of hosts.sam" file to "Hosts" [no quotes]. Notice that there is no extension. Windows will complain about renaming it but ignore the nag. 4 - The Hosts file can be opened & edited with any text editor such as Notepad.exe. Don't edit it with a word processor such as Wordpad.exe. Fortunately, there already exists lists of common ad serving domains neatly compiled with the 127.0.0.1 address in a Hosts friendly format. One such list can be found at http://www.ecst.csuchico.edu/~atman/spam/adblock.shtml . Copy, then paste the list of ad server domains with the 127.0.0.1 IP addresses from that webpage into your Hosts file. |
|
|
|
Your new Hosts file will now block the major ad serving domains from placing ads on the web pages you access.
However, depending on what software you use [such as free ISPs] and where you browse, many ads will still get through.
To add your own entries to the Hosts file, use IE4/5's cache of browsed files; it is a gold mine of ad server domain names. The
name of the cache folder is Temporary Internet Files [AKA TIF]. 1 - First, clear the TIF, from "Internet Options/General Tab/Delete Files". Check "Delete all offline content", select OK twice. 2 - Put a shortcut to the TIF and the Hosts file on your Desktop. 3 - After browsing various websites [especially, the larger, commercial ones] with one or more of your ISPs and signing off, open the TIF shortcut to find ads which may have appeared on webpages you accessed. [Note: Set your TIF view to "Details" by selecting View on the Menu Bar.] Ads are usually "gif" files whose URLs appear to be from ad servers. The domain names of these ad servers can be copied from the Address Bar if you open the "gif" or from "Properties" when right clicking on the "gif". Paste just the domain name, not the entire file name into the Hosts file after entering 127.0.0.1 and a space. Each entry in the Hosts file should be on a separate line. [Note: If, when trying to open a TIF file, you receive a message that "Running a system command on this item might be unsafe. Do you wish to continue?", select Yes. If you get a message that "Your current security settings do not allow you to perform system commands on this item.", then enable or prompt "Launching programs and files in an IFRAME" in Internet Options/Security Tab.] |
|
Browsing is speedier, and content is served faster. Some Ad servers have been found to collect data about the browsing habits, preferences, and personal information of the surfer; do not surrender or compromise your privacy or best interests to those who would use you for their own ends. Periodically, examine your Cache [TIF] to update your Hosts file. Within the first day of adding the list cited in the above link, I added over 50 ad servers. If you are a user of the free X-SetUp Tweaking Utility, there is a plugin on my Plugin Page which will assist in working with TIF files; it will allow you to "read" Cache files by setting IFRAME preferences if warnings occur. Another free useful utility, which will allow you to place Notepad [or any other application] in the right click [context] menu of both the HOSTS file and its shortcut, is Multilaunch . Here's how to use NOTEPAD to open NO EXTENSION files. |
|
1 - If you use AOL and have placed Ad Server domain names with 127.0.0.1 in your Hosts file, browse the web OVER the
AOL shell; in other words, open your browser as a standalone application when you want to access websites that use
advertisements. |
|
Some websites redirect you to another page whether you want to go there or not. One such website is Hotmail; when the visitor logs off from Hotmail, the MSN home page [www.msn.com] is served up. To stop this behaviour, one can put www.msn.com into the HOSTS file; a "The page cannot be displayed" message will appear. |
|
MAP YOUR HOSTS & NO ADS THANK YOU! The above links are also included in TIPS95.TXT, part of AXCEL216's Win9x/2000 + DOS 7.xx Tricks + Secrets files [W95-11D.ZIP, freeware] at http://user.aol.com/axcel216/95.htm |