public class HostUtils extends Object
Constructor and Description |
---|
HostUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isValidHostname(String hostname)
Validates a hostname to ensure it meets the specifications described in RFC 1123.
|
public static boolean isValidHostname(String hostname)
Note: this does not validate whether the host exists or if the name is a valid DNS name. For example, host.example.anything is a valid host name however may be an invalid DNS name since "anything" may not be a valid top-level domain.
hostname
- a hostnameCopyright © 2022 Apache Software Foundation. All rights reserved.