code: static String normalizeDefaultHostname(String defaultHostname) {
          requireNonNull(defaultHostname, "defaultHostname");
          if (needsNormalization(defaultHostname)) {
              defaultHostname = IDN.toASCII(defaultHostname, IDN.ALLOW_UNASSIGNED);
          }
  
          if (!HOSTNAME_PATTERN.matcher(defaultHostname).matches()) {
              throw new IllegalArgumentException("defaultHostname: " + defaultHostname);
          }
  
          return Ascii.toLowerCase(defaultHostname);
      }
docs: IDNA ASCII conversion, case normalization and validation.