title: querying dns server in java
body: <p>when using dig to query a particular dns server you get the following:
  dig @e.root-servers.net test.it.  </p>
  
  <pre>
  ;  DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6  @e.root-servers.net test.it
  ; (1 server found)
  ;; global options: +cmd
  ;; Got answer:
  ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 7, ADDITIONAL: 14
  ;; WARNING: recursion requested but not available
  
  ;; QUESTION SECTION:
  ;test.it.           IN  A
  
  ;; AUTHORITY SECTION:
  it.         172800  IN  NS  a.dns.it.
  it.         172800  IN  NS  c.dns.it.
  it.         172800  IN  NS  m.dns.it.
  it.         172800  IN  NS  r.dns.it.
  it.         172800  IN  NS  s.dns.it.
  it.         172800  IN  NS  dns.nic.it.
  it.         172800  IN  NS  nameserver.cnr.it.
  </pre>
  
  <p>However I'm not getting anything using the following java code using dnsjava.</p>
  
  <pre>
          Lookup lookup = new Lookup("test.it", Type.NS);
          SimpleResolver resolver=new SimpleResolver("e.root-servers.net");
  
          //Message msg=new 
          //resolver.send(msg);
          lookup.setDefaultResolver(resolver);
          lookup.setResolver(resolver);
          Record [] records = lookup.run();
          for (int i = 0; i &lt; records.length; i++) {
               Record  r = (Record ) records[i];
              System.out.println(r.getName()+&quot;,&quot;+r.getAdditionalName());
          }
  </pre>
  
  <p>what's wrong?</p>