From: Brian W. <bwe...@xb...> - 2004-04-02 05:05:38
|
On Wed, 31 Mar 2004, testttt wrote: > Hi, Brian and all others, > > In order to use DNSJava in my box without extensively configuring it, I > found it's handy if DNSJava can query a sub-DNS before it returns an > empty query result. This will work with the *nix resolv library. So, I > did some very simple change to jnamed.java: > > 1. a new keyword 'sub-dns' for jnamed.conf. It has a ip and an optional > port attribute; > 2. create a SimpleResolver object for each sub-dns attribute; > 3. When jnamed is returning response to a query, it checks if the answer > section in the response is empty or not; > 4. If empty, it will try the configured SimpleResolver object to resolve > the query; > 5. break until the response has non-empty answer section, or all sub-dns > has been tried; > > So far, it works ok in my machine. I would like to get some comments > from Brian or whoever is interested. And ultimately, I'd like this > feature in DNSJava or merge my change into DNSJava. Please let me know! It looks like you're trying to implement something like BIND's forwarders, which is a reasonable thing to do. It's unclear from your code what you actually want to do with the queries, though - checking for a non-empty answer section isn't right, because if a server returns a valid negative answer, you should believe it and not ask anyone else. The bigger question, though, is why are you using the dnsjava server? Its error handling is virtually non-existant, it's not fast, and it doesn't do much. I'd really recommend just running BIND with forwarders. Brian |