netty5/resolver-dns/src/test/java/io/netty/resolver/dns
Anuraag Agrawal 4cd39cc4b3 Filter DNS results so they only contain the expected type when multiple types are present. (#7875)
Motivation:

Currently, if a DNS server returns a non-preferred address type before the preferred one, then both will be returned as the result, and when only taking a single one, this usually ends up being the non-preferred type. However, the JDK requires lookups to only return the preferred type when possible to allow for backwards compatibility.

To allow a client to be able to resolve the appropriate address when running on a machine that does not support IPv6 but the DNS server returns IPv6 addresses before IPv4 addresses when querying.

Modification:

Filter the returned records to the expected type when both types are present.

Result:

Allows a client to run on a machine with IPv6 disabled even when a server returns both IPv4 and IPv6 results. Netty-based code can be a drop-in replacement for JDK-based code in such circumstances.

This PR filters results before returning them to respect JDK expectations.
2018-04-19 10:52:22 +02:00
..
DefaultDnsCacheTest.java DefaultDnsCache should expire all records per hostname when one TTL is reached. 2018-01-31 14:39:31 +01:00
DnsNameResolverClientSubnetTest.java DNS Resovler tests should be more explicit about ndots 2017-07-12 15:49:45 -07:00
DnsNameResolverTest.java Filter DNS results so they only contain the expected type when multiple types are present. (#7875) 2018-04-19 10:52:22 +02:00
DnsServerAddressesTest.java DNS move JDK DNS resolution out of DnsServerAddresses static initialization 2017-04-06 18:09:58 -07:00
SearchDomainTest.java Fix typos in docs. 2018-02-14 08:44:07 +01:00
TestDnsServer.java Filter DNS results so they only contain the expected type when multiple types are present. (#7875) 2018-04-19 10:52:22 +02:00
UnixResolverDnsServerAddressStreamProviderTest.java UnixResolverDnsServerAddressStreamProvider should allow for empty /etc/resolver dir 2017-07-05 20:14:27 -04:00