0

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!

Kirk Ouimet
  • 27,280
  • 43
  • 127
  • 177

1 Answers1

1

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
  • 38,754
  • 10
  • 77
  • 102