The InetAddress class contains a method that can return the domain name of an IP address. We need to obtain an InetAddress class, and then call its getHostName() method. This will return the hostname for that IP address. Depending on the platform, a partial or a fully qualified hostname may be returned.
InetAddress inet = InetAddress.getByName(\"22.214.171.124\");
System.out.println (\"Host: \" + inet.getHostName())