From: Brian W. <bwe...@xb...> - 2001-12-08 00:58:55
|
On Fri, 7 Dec 2001, Jennifer Orf wrote: > Hello, > > I'm building an app where I need to perform a whole bunch of reverse dns > lookups very rapidly. Thus, the faster I can look an address up, the better. > > In addition, I'd like the resolved addresses to always come back as fully > qualified domain names. > > I am curious as to whether dnsjava would be a better solution than using > java.net.InetAddress on either or both of these counts. > > Could anyone provide me insight on this, please? I've never benchmarked dnsjava against InetAddress for straight reverse lookups (or forward lookups, for that matter). It's not an especially complicated process, so I'd imagine the differences in speed would be negligible. I believe dnsjava's caching is more correct that that of InetAddress, since it properly expires DNS records. This may have a slight negative impact on performance if you're relying on caching and the records have low TTLs, but is correct behavior. If your app is threaded, dnsjava may have an advantage, since on some platforms, InetAddress-based lookups can only occur in one thread at a time (since gethostbyaddr() blocks). Another possible advantage of dnsjava is that asynchronous lookups are possible when using lower-level APIs (Resolver.send()). The high level APIs (dns.getRecords*(), Address) do not have async functions, but they would not be particularly difficult. As for fully qualified domain names, both dnsjava methods and InetAddress should give you that. Hope this helps... Brian |