@Override
    public DnsServerAddressStream nameServerAddressStream(String hostname) {
        for (;;) {
            int i = hostname.indexOf('.', 1);
            if (i < 0 || i == hostname.length() - 1) {
                return defaultNameServerAddresses.stream();
            }

            DnsServerAddresses addresses = domainToNameServerStreamMap.get(hostname);
            if (addresses != null) {
                return addresses.stream();
            }

            hostname = hostname.substring(i + 1);
        }
    }
@Test
    public void ipv6Nameserver(@TempDir Path tempDir) throws Exception {
        File f = buildFile(tempDir, "search localdomain\n" +
                "nameserver 10.211.55.1\n" +
                "nameserver fe80::21c:42ff:fe00:18%nonexisting\n");
        UnixResolverDnsServerAddressStreamProvider p =
                new UnixResolverDnsServerAddressStreamProvider(f, null);

        DnsServerAddressStream stream = p.nameServerAddressStream("somehost");
        assertHostNameEquals("10.211.55.1", stream.next());
    }