private boolean isValidHostname(String hostname) {
        if (hostname == null) {
            return false;
        }
        try {
            InetAddress.getByName(hostname);
            return true;
        } catch (UnknownHostException e) {
            log.error("DNS resolution failed for hostname: {}", hostname, e);
            return false;
        }
    }
Validates the hostname by performing DNS resolution.

@param hostname The hostname to validate.
@return true if the hostname is valid, false otherwise.
inlong-tubemq/tubemq-manager/src/main/java/org/apache/inlong/tubemq/manager/service/MasterServiceImpl.java