From: Brian W. <bwe...@xb...> - 2003-05-23 17:06:21
|
On Fri, 23 May 2003, Jürgen Hoffmann wrote: > I am trying to query a nameserver for a zone which should be configured > their and the corresponding configured Nameservers. > > Easily speaking I am trying to see if the nameservers for a given zone > are configured correctly. > > What I have so far is this: > > Records [] r = dns.getAnyRecords("byteaction.de", Type.NS) > for(int i=0; i<r.length; i++) > { > System.out.println(r[i].rdataToString()); > } > > But this does not work. I hav tried to set the Resolver explicitly with > > ExtendedResolver er = new ExtendedResolver(new String[] > {"212.223.69.193"}); > dns.setResolver(er); > > And then run the query but both won't work =( You're issuing a recursive query for type NS, which is causing the server to recursively attempt to find the NS records in the child zone, not the parent zone. Depending on the server configuration, this might not work. Issuing a non-recursive query is not particularly difficult (turn off the RD flag in the DNS header of the query), but neither the dns or Lookup class allows you to do that (since it's not something that applications usually do), You'd need to construct the message by hand and use the Resolver to send it. Brian |