Editing /etc/hosts

Ken Schweigert yellowdog-general@lists.terrasoftsolutions.com
Thu Apr 29 07:19:01 2004


On Wed, Apr 28, 2004 at 05:51:17PM -0400, Andrew wrote:
> I've just read an article on Slashdot
>  <http://slashdot.org/article.pl?sid=04/04/28/2011234>
> about some new Ad technology... it mention the use of a customized HOSTS
> file <http://www.everythingisnt.com/hosts.html> (see the Linux/Unix/Mac 
> OSX section down there) It say I should replace my /etc/hosts file with 
> the one provided <http://www.everythingisnt.com/Hosts> to block all
> those banner-ads from loading their sh*t into my web browser...
> 
> My question is: Shouldnt it goes in /etc/hosts.deny instead of
> /etc/hosts ??????? hmm??

I've been using that hosts file for a couple weeks now and it works great.
I occassionally get a banner ad, but not very often.  A lot of the news
sites load significantly faster, too.

The /etc/hosts is correct.  /etc/hosts.deny is a file that works with 
the inetd daemon for restricting access to internet services.  

When you request a DNS lookup, linux will first look in /etc/hosts and then
do a DNS lookup to the servers listed in /etc/resolv.conf.  If it's looking
up, say, ads.doubleclick.net, it first looks and /etc/hosts and if you are
using everythingisnt's hosts file it will resolve to 127.0.0.1 which will
give you a broken image instead of an ad.  A good thing.

HTH

-- 
Ken Schweigert, Network Administrator
Byte Productions, LLC
http://www.byte-productions.com