I'm trying to do a WHOIS query with the WhoisClient object, and things aren't working out well. My code is pretty simple:
String WHOIS_SERVER = WhoisClient.DEFAULT_HOST;
int WHOIS_PORT = 43;
String hostName = "www.google.com";
WhoisClient whoisClient = new WhoisClient();
try
{
whoisClient.connect(WHOIS_SERVER, WHOIS_PORT);
String results = whoisClient.query(hostName);
return results;
}
catch(IOException e)
{
....
}
So a few things are wrong. I get the registrar information, but don't get the owner info. Also, there's lots of information about Google domains in other TLDs not just google.com.
I'm pretty sure I'm not specifying the host properly to get what I want. The documentation says:
It is up to the programmer to be familiar with the handle syntax of the whois server.
Not sure what that means. How can I do this better?