code: public static InetAddress
      getByName(String name) throws UnknownHostException {
          try {
              return getByAddress(name);
          } catch (UnknownHostException e) {
              Record[] records = lookupHostName(name);
              return addrFromRecord(name, records[0]);
          }
      }
docs: Determines the IP address of a host
  
  @param name The hostname to look up
  @return The first matching IP address
  @throws UnknownHostException The hostname does not have any addresses