public MockNameResolver addRecord(String hostname, String... ipAddress) {
        Objects.requireNonNull(hostname, "hostname must be non-null");
        Arrays.stream(ipAddress).forEach(ip -> Objects.requireNonNull(ip, "ipAddress must be non-null"));
        records.computeIfAbsent(hostname, (k) -> new HashSet<>())
               .addAll(List.of(ipAddress));
        return this;
    }
A mock DNS resolver. Can be configured to only answer specific lookups or any lookup.

@author mpolden
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockNameResolver.java