根据 IP 查找机器名ping -a localhostInetAddress addr InetAddress.getByName(16.173.244.212)// Ge
根据 IP 查找机器名
ping -a localhost
InetAddress addr = InetAddress.getByName("16.173.244.212"); // Get the host name String hostname = addr.getHostName(); System.out.println(hostname); // Get canonical host name String hostnameCanonical = addr.getCanonicalHostName(); 