根据 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();