private static List<String> resolveAll(NameType type, DomainName name) {
        try {
            DirContext ctx = new InitialDirContext();
            try {
                String entryType = type.name();
                Attributes attributes = ctx.getAttributes("dns:/" + name, new String[]{entryType});
                Attribute attribute = attributes.get(entryType);
                if (attribute == null) {
                    return List.of();
                }
                List<String> results = new ArrayList<>();
                attribute.getAll().asIterator().forEachRemaining(value -> {
                    String answer = Objects.toString(value);
                    answer = answer.endsWith(".") ? answer.substring(0, answer.length() - 1) : answer; // Trim trailing dot
                    results.add(answer);
                });
                return Collections.unmodifiableList(results);
            } finally {
                ctx.close();
            }
        } catch (NameNotFoundException ignored) {
            return List.of();
        } catch (NamingException e) {
            throw new RuntimeException(e);
        }
    }
Returns all answers for given type and name. An empty list is returned if name does not exist (NXDOMAIN)
config-provisioning/src/main/java/com/yahoo/config/provision/EndpointsChecker.java