You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by Per Jessen <pe...@computer.org> on 2009/07/01 09:32:33 UTC

How do I make Net::DNS::Resolver take /etc/hosts into account?

All,

for whatever reason, Net::DNS::Resolver (as used in SA) doesn't appear
to look at /etc/hosts.  I thought it was a Net::DNS::Resolver
peculiarity, maybe something to do with cross-platform support, so in 
a plugin module I've been writing, I tried to gethostbyname() instead.
I verified it outside of SA, and gethostbyname() does, as expected,
also consult /etc/hosts (provided /etc/nsswitch is correct configured). 
However, when I use gethostbyname() from within SA, it does not
consult /etc/hosts ... which led me to conclude that Net::DNS::Resolver
does something to the resolver setup (at init-time) which makes it
ignore /etc/hosts. 

Back to the subject line - how do I make Net::DNS::Resolver
take /etc/hosts into account?


/Per Jessen, Zürich