views:

89

answers:

2

phpwhois is a script for PHP that allows you to perform whois lookups on any domain:

http://sourceforge.net/projects/phpwhois/

Does anyone know of a comparable Java package that can accomplish the same thing?

Thanks!

A: 

See if this helps.

JG
Should work :-)
Toader Mihai Claudiu
+1  A: 

Jakarta Commons NET claims to support Whois. Haven't used it, but generally Jakarta has reasonable APIs.

Looking at the API docs, it appears to be very easy:

WhoisClient whois;

whois = new WhoisClient();

try {
  whois.connect(WhoisClient.DEFAULT_HOST);
  System.out.println(whois.query("foobar"));
  whois.disconnect();
} catch(IOException e) {
  System.err.println("Error I/O exception: " + e.getMessage());
  return;
}
kdgregory