Whois improvement

pull/209/head
M66B 2 years ago
parent 5e512ecaea
commit 3645e4440e

@ -25,6 +25,7 @@ import java.net.Socket;
import java.net.UnknownHostException;
public class Whois {
// https://datatracker.ietf.org/doc/html/rfc812
private static final int WHOIS_PORT = 43;
private static final int WHOIS_TIMEOUT = 15 * 1000; // milliseconds
@ -40,7 +41,7 @@ public class Whois {
Socket socket = new Socket();
socket.connect(new InetSocketAddress(host, port), WHOIS_TIMEOUT);
try {
socket.getOutputStream().write((domain + "\n").getBytes());
socket.getOutputStream().write((domain + "\r\n").getBytes());
return host + ":" + port + "\n" + Helper.readStream(socket.getInputStream());
} finally {
socket.close();

Loading…
Cancel
Save