如何根据IP获得主机名+主DNS后缀
java如何根据IP获得主机名+主DNS后缀(primary DNS suffix)
------解决方案--------------------import java.net.*;
public class T1 {
public static void main(String args[]){
InetSocketAddress is = new InetSocketAddress( "127.0.0.1 ",8080);
System.out.println(is.getHostName());
}
}
------解决方案--------------------Process p = Runtime.getRuntime().exec( "ipconfig/all ");
InputStream is = p.getInputStream();
根据得到的流的位置去定位就好了