code: @Beta
      public static String checkHostname(String hostname,
                                         @Nullable String errorMessageTemplate,
                                         @Nullable Object... errorMessageArgs) {
          String message = messageFromNullable(errorMessageTemplate, errorMessageArgs, "; ");
  
          checkArgument(hostname != null, "%sExpected non-null hostname", message);
          checkArgument(hostname.length() > 0 && hostname.length() < 256,
                  "%sExpected a hostname in range 1 to 255 characters, got %s", message, hostname.length());
  
          Iterable<String> labels = on('.').split(hostname);
          for (String label : labels) {
              checkArgument(label.length() > 0 && label.length() < 64,
                      "%sExpected a hostname label in range 1 to 63 characters, got %s", message, label.length());
          }
  
          checkMatches(hostname, compile(REGEXP_HOSTNAME),
                  "%sExpected a hostname to match expression %s, got: %s", message, REGEXP_HOSTNAME, hostname);
          return hostname;
      }
docs: Performs a hostname check against: RFC 952, RFC 1123 and RFC 1034
  
  @param hostname hostname to check
  @return checked hostname
  @throws IllegalArgumentException if the {@code hostname} is invalid
  @throws NullPointerException     if the {@code hostname} is null