code: public static String getHostName(String _ipAddress) {
          try {
              InetAddress addr = InetAddress.getByName(_ipAddress);
              return addr.getHostName();
          } catch (Exception _ex) {
              return _ipAddress;
          }
      }
docs: Get the host name of a local address, if available.
  
  @param _ipAddress the IP address
  @return the host name, or the original IP if name not available