On 2007/10/13 11:43, Karel Kulhavy wrote: > 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?
resolv.conf(5) is correct, The resolv.conf file specifies how the resolver(3) routines in the C li- brary (which provide access to the Internet Domain Name System) should operate. N.B. Not all software uses the resolver(3) routines. Software wanting more control of DNS queries (e.g. timeouts), more information about responses, or async lookup, avoids them. ping/ftp/telnet do use these routines so you can see the effect of the changes you made there. For Firefox, your choices could include adblock, running your own DNS cache and override these hosts with your own zones, or for a lightweight method (messy but it works quite well) you could try dnsspoof from the dsniff package.