List of usage examples for org.apache.commons.net.whois WhoisClient query
public String query(String handle) throws IOException
From source file:org.oucho.whois.LookupWhoisTask.java
protected String doInBackground(String... urls) { String url = urls[0];//from w w w .j a va 2 s .c om String[] parts = url.split("\\:"); String adresse = parts[0]; String host = parts[1]; if ("whois.internic.net".equals(host)) adresse = "=" + adresse; StringBuilder result = new StringBuilder(""); WhoisClient whois = new WhoisClient(); try { whois.connect(host); String whoisData1 = whois.query(adresse); result.append(whoisData1); whois.disconnect(); } catch (SocketException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return result.toString(); }