Monday, July 25, 2011

How to use Hosts file

Path: C$\Window\system32\drivers\etc\
hosts
Imhosts.sam
networks
protocol
services


NOTE: Hosts is the name of the hosts file and not another directory name. It does not have an extension (extensions are the .exe, .txt, .doc, etc. endings to filenames) and so appears to be another directory in the example above.

CAUTION: If you find that you already have a "Hosts" file on your computer, I recommend that you back it up into another directory on your hard drive so that you may restore it if you do not like the results of the ad-blocking, or in case something else goes wrong while you are trying to set this up. It is always better to be safe than sorry in the event of an unforeseen mishap. Please make a backup copy.

"Hosts": Make sure you use the quotes to keep the file from being saved with an extension (like .txt). If you find the file has an extension, you will need to get rid of the extension by renaming the file in Explorer to simply "Hosts".

With a proxy server:
You should only need to do this step if you use a proxy server. Examples of proxy servers include: WebWasher, CookieCop Plus, and a web cache server provided by your ISP. If your hosts file does not seem to be working for you and you skipped this step, try coming back and completing this process.

In IE - choose tools:internet options:connections and choose your connection. If you are using a proxy server, make sure the box called "bypass proxy server for local addresses" is checked.
In Netscape - go to Edit: Preferences: Advanced: Proxies and click the manual setting. Then click on view and type "127.0.0.1" into the exceptions box at the bottom.
To disable Hosts from a DOS window:

cd windows (press enter)                                 rename hosts hosts.txt (press enter) 

To Enable Hosts from a DOS window:

cd windows (press enter)                                 rename hosts.txt hosts (press enter)

You can also use this to rename your Hosts file if it accidently has an extension on it.

*Do not do this if you use a proxy server, or the proxy will not work. In that case, you would have to delete all entries from your "Hosts" file except for the proxy entries to get the equivalent of disabling the Hosts file. To restore the ad-blocking Hosts file, you would then have to paste all the deleted entries back inside "Hosts".

Use browser to test changes
You may test your configuration by trying to visit a site that is listed in the Hosts file. Type in a site such as "www.alladvantage.com" and if your browser can not access it then you are in business! If you have problems, try closing your browser and reopening it, or try emptying your browser's cache before trying again. Also, you may need to reboot in some cases.

Another testing method is to see whether or not ads are being blocked on most of the sites you visit. Of course, not every ad will be blocked because of the restrictions listed above. You will be able to tell this by the fact that you will see empty boxes in the spots you used to see ads. If you would like to see some kind of picture there instead of the empty box while still blocking ads

Editing a "Hosts" file 
--------------------------------------------------------------------------------------------
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost
192.168.xxx.xxx servername
192.168.xxx.xxx servername.domain.local
-----------------------------------------------------------------------------

No comments:

Post a Comment