On Sat, Oct 13, 2007 at 11:43:46AM +0200, Karel Kulhavy wrote:
> I want to make my OS return 127.0.0.1 on google-analytics.com and
> ad.doubleclick.net to speed up the work with Sourceforge.
> 
> I put 
> 127.0.0.1 google-analytics.com
> 127.0.0.1 ad.doubleclick.net
> into /etc/hosts
> 
> and checked that /etc/resolv.conf contains
> lookup file bind
> 
> According to man resolv.conf this should result in /etc/hosts having priority
> over the DNS system. However, it simply doesn't work. Both Firefox and the
> "host" command behave as if I didn't do anything.
> 
> Why doesn't it work when man resolv.conf says it should?
> 

Because neither the host command nor firefox are using gethostbyname() and
friends. So both do not look at /etc/hosts on the other hand most other
apps like ping, telnet, ssh or nc are using gethostbyname() and therefor
read /etc/hosts.

-- 
:wq Claudio

Reply via email to