title: Need to perform a reverse DNS lookup of a particular IP address in java
body: <p>I need to get the DNS address, for example <strong>"http://stackoverflow.com/questions/ask"</strong>. I used the following code and able to get in the form of 192.X.X.X.</p>
  
  <pre><code>  Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.dns.DnsContextFactory");
    DirContext ictx = new InitialDirContext(env);
    String dnsServers = (String) ictx.getEnvironment().get("java.naming.provider.url");
  
    System.out.println("DNS Servers: " + dnsServers ); 
  </code></pre>