|
|
|
@ -44,8 +44,12 @@ package de.anomic.net;
|
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.io.InputStreamReader;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Properties;
|
|
|
|
|
|
|
|
|
|
import de.anomic.http.httpc;
|
|
|
|
|
import de.anomic.tools.nxTools;
|
|
|
|
|
|
|
|
|
|
public class whois {
|
|
|
|
|
|
|
|
|
|
public static Properties Whois(String dom) {
|
|
|
|
@ -83,7 +87,23 @@ public class whois {
|
|
|
|
|
return "unknown";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String reversedns(String ip) {
|
|
|
|
|
try {
|
|
|
|
|
ArrayList x = nxTools.strings(httpc.wget(new URL("http://www.dnsstuff.com/tools/ptr.ch?ip=" + ip)));
|
|
|
|
|
x = nxTools.grep(x, 0, "PTR record:");
|
|
|
|
|
if ((x == null) || (x.size() == 0)) return null;
|
|
|
|
|
String line = nxTools.tail1(x);
|
|
|
|
|
int p = line.indexOf("<B>");
|
|
|
|
|
int q = line.indexOf("</B>");
|
|
|
|
|
if ((p > 0) && (q > 0)) return line.substring(p + 3, q);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
/*
|
|
|
|
|
Properties p = Whois(args[0]);
|
|
|
|
|
if (p != null) {
|
|
|
|
|
System.out.println(p);
|
|
|
|
@ -91,5 +111,7 @@ public class whois {
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("whois cannot execute");
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
System.out.println(reversedns("85.212.45.94"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|