Skip to content

Instantly share code, notes, and snippets.

@mwchambers
Created October 26, 2011 11:27
Show Gist options
  • Save mwchambers/1316080 to your computer and use it in GitHub Desktop.
Save mwchambers/1316080 to your computer and use it in GitHub Desktop.
Java Reverse DNS
import java.net.InetAddress;
public class reversedns
{
public static void main(String args[])
{
try {
InetAddress addr = InetAddress.getByName("172.16.0.105");
System.out.println(addr.getHostName());
}
catch (Exception e)
{
System.err.println("Error: " + e.getMessage());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment