code: public static String getHostStringWithoutNameLookup(InetSocketAddress inetSocketAddress) {
          String newHost;
          if (inetSocketAddress.isUnresolved()) {
              newHost = inetSocketAddress.getHostName();
          } else {
              newHost = inetSocketAddress.getAddress().getHostAddress();
          }
          return newHost;
      }
docs: A Java 6/7 safe way of looking up a host name from an InetSocketAddress
  without tickling a name lookup.
  
  @param inetSocketAddress the address for which you want a host string
  @return a hostname for the given address, having not triggered a name service lookup