title: JNDI DNS lookup with partial domain name
body: <p>For example if I have the following SRV record defined in my DNS config</p>
  
  <pre><code>_dev._tcp          IN      SRV     0       0       8400   dev.server.com.
  </code></pre>
  
  <p>I can execute the following command</p>
  
  <pre><code>host -lt SRV server.com
  </code></pre>
  
  <p>And it gives me complete list of SRV records in the dns server(server.com). If I want to do the same thing using JNDI lookup</p>
  
  <pre><code>Hashtable&lt;String, String&gt; env = new Hashtable&lt;String, String&gt;();
  env.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory");
  DirContext ctx = new InitialDirContext(env);
  Attributes attributes = ctx.getAttributes("server.com", new String [] { "SRV" });
  return attributes;
  </code></pre>
  
  <p>The above code is not returning any attributes. If I change the penultimate line in the above code to this,</p>
  
  <pre><code>Attributes attributes = ctx.getAttributes("_dev._tcp.server.com", new String [] { "SRV" });
  </code></pre>
  
  <p>it works.</p>
  
  <p>But the problem is I don't know the complete domain name in prior and I have to lookup the SRV record to find the complete domain name.</p>
  
  <p>Any ideas as how to do this?</p>