code: protected synchronized InetAddress getHostAddress(URL u) {
          if (u.hostAddress != null)
              return (InetAddress) u.hostAddress;
  
          String host = u.getHost();
          if (host == null || host.equals("")) {
              return null;
          } else {
              try {
                  u.hostAddress = InetAddress.getByName(host);
              } catch (UnknownHostException ex) {
                  return null;
              } catch (SecurityException se) {
                  return null;
              }
          }
          return (InetAddress) u.hostAddress;
      }
docs: Get the IP address of our host. An empty host field or a DNS failure
  will result in a null return.
  
  @param u a URL object
  @return an {@code InetAddress} representing the host
  IP address.
  @since 1.3