I'd suggest Net::DNS over gethostbyaddr.. From the man pages of Net::DNS::Resolver that I was able to locate off Google,
tcp_timeout can be used to set the timeout for queries, the default being 120 sec
After using gethostbyaddr for a reporting/log file analysis tool that I wrote not too long ago, I might even suggest a locally cached copy of addresses.. this made a significant difference in the speed of the app for subsequent invocations..
HTH
| [reply] |
Net::DNS is a better tool if resolving is causing a lot
of problems. It allows better user control over how the
resolver works.
If you're an admin on a UNIX-type system, you can tweak your resolver
to make it work better. The defaults are really lax and
can cause problems like you have encountered. As a bonus,
this will speed up everything on the system that uses DNS.
For Linux, BSD, and the like, /etc/resolv.conf is used to control the behaviour
of the resolver. There are some parameters such as
timeout which can speed things up for failed
results, and you can use more than one DNS server using
the rotate option.
More details at: man resolv.conf
| [reply] [d/l] [select] |