Per Jessen wrote: > Theo Van Dinter wrote: > >> On Wed, Jul 1, 2009 at 3:23 AM, Per Jessen<p...@computer.org> wrote: >>> Back to the subject line - how do I make Net::DNS::Resolver >>> take /etc/hosts into account? >> b) my guess is that you can't, but it's a question for the Net::DNS >> folks, not SA. > > Theo, I do appreciate that, but something SA or Net::DNS does changes > the behaviour of subsequent calls to gethostbyname(), so the question > is who is the culprit? Can you say for certain that SA isn't the > guilty part? (just so I can start digging into Net::DNS instead).
On many operating systems (Solaris, Fedora 11, and Gentoo Linux are the ones I have) the file /etc/nsswitch.conf controls exactly what you are asking, the usual relevant line is: hosts: files dns Which means first look at /etc/hosts, then ask bind (named). In Fedora 11 the same line is more complex, returning an error before using named, but that is not your problem: hosts: files mdns4_minimal [NOTFOUND=return] dns -- René Berber