public ListenerInfo withWildcardHostnamesResolved() throws UnknownHostException {
        LinkedHashMap<String, Endpoint> newListeners = new LinkedHashMap<>();
        for (Map.Entry<String, Endpoint> entry : listeners.entrySet()) {
            if (entry.getValue().host() == null || entry.getValue().host().trim().isEmpty()) {
                String newHost = InetAddress.getLocalHost().getCanonicalHostName();
                Endpoint prevEndpoint = entry.getValue();
                newListeners.put(entry.getKey(), new Endpoint(prevEndpoint.listenerName().get(),
                        prevEndpoint.securityProtocol(),
                        newHost,
                        prevEndpoint.port()));
                log.info("{}: resolved wildcard host to {}", entry.getValue().listenerName().get(),
                        newHost);
            } else {
                newListeners.put(entry.getKey(), entry.getValue());
            }
        }
        return new ListenerInfo(newListeners);
    }
Create a new ListenerInfo object where null or blank hostnames (signifying that the user
asked to bind to 0.0.0.0) are replaced by specific hostnames.

@return A new ListenerInfo object.
metadata/src/main/java/org/apache/kafka/metadata/ListenerInfo.java