Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Why do this?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Why do this?
Authored by: babbage on May 15, '01 11:17:11AM
I plead naivete -- it seems to me that the main benefits of this would be [a] managing a local network
and [b] providing caching/backup for DNS. I know there are better reasons, but I'm
mostly unaware of them.

The main reason I use the hosts file on my NT box (what? BSD-ness on NT? Ye gods! And
yet there it is -- C:WINNTsystem32driversetcHOSTS -- and I didn't even put it there) is as a sort
of junkbuster-esque banner ad filter. Basically, if you map any known ad server to the localhost
address (127.0.0.1), you are effectively piping it to /dev/null.

Sweet. Not what it's there for, I'm sure, but very nice all the same.

Here's my NT hosts file. It's the same format as it would be on any other system, so you should be
able to use it on OSX or *nix or whatever else you like (OS9? Not sure...).

# Copyright (c) 1993-1995 Microsoft  Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows NT.
#
# 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
127.0.0.1 207-87-18-203.wsmg.digex.net
127.0.0.1 Garden.ngadcenter.net
127.0.0.1 Ogilvy.ngadcenter.net
127.0.0.1 ResponseMedia-ad.flycast.com
... ... ..
[NOTE: long list of hosts deleted; email babbage directly (by clicking on the linked username) if
you'd like a copy of the whole file].

You get the idea. Any site you want to filter out, just add a line like
"127.0.0.1     ads.offendingsite.com", and you'll never see it on a web page again, nicely replaced by
(if you're running a local webserver) an easily ignored "404 not found" page.

[ Reply to This | # ]
CDDB/freedb and ad blocking tricks
Authored by: j-beda on May 15, '01 04:22:44PM
What I would like to do is modify the way iTunes (and other programs) access the database of song titles. There are instructions for doing so in OS 9.1 by playing with the hosts, but no instructions for OS X, here: http://www.cam.org/~cwatson/freedb/freedb.html There are unix style hosts files for this CD trick that I will now be able to try with Mac OS X. http://www.freedb.org/sections.php?op=viewarticle&artid=46 A list of ad domains for hosts files is maintained at: http://www.ecst.csuchico.edu/~atman/spam/adblock.shtml

[ Reply to This | # ]