netty5/resolver-dns/src/test/java/io/netty/resolver/dns
Norman Maurer 5650db5826
Add cache for CNAME mappings resolved during lookup of DNS entries. (#8314)
* Add cache for CNAME mappings resolved during lookup of DNS entries.

Motivation:

If the CNAMEd hostname is backed by load balancing component, typically the final A or AAAA DNS records have small TTL. However, the CNAME record itself is setup with longer TTL.

For example:
* x.netty.io could be CNAMEd to y.netty.io with TTL of 5 min
* A / AAAA records for y.netty.io has a TTL of 0.5 min

In current Netty implementation, original hostname is saved in resolved cached with the TTL of final A / AAAA records. When that cache entry expires, Netty recursive resolver sends at least two queries — 1st one to be resolved as CNAME record and the 2nd one to resolve the hostname in CNAME record.
If CNAME record was cached, only the 2nd query would be needed most of the time. 1st query would be needed less frequently.

Modifications:

Add a new CnameCache that will be used to cache CNAMEs and so may reduce queries.

Result:

Less queries needed when CNAME is used.
2018-09-27 17:05:35 +02:00
..
DefaultAuthoritativeDnsServerCacheTest.java Correctly handle DNS redirects for NS servers that have no ADDITIONAL record (#8177) 2018-08-22 17:49:22 +02:00
DefaultDnsCacheTest.java Correctly handle hostnames with and without trailing dot in the DefaultDnsCache and use it for searchdomains. (#8181) 2018-08-10 08:53:59 +02:00
DefaultDnsCnameCacheTest.java Add cache for CNAME mappings resolved during lookup of DNS entries. (#8314) 2018-09-27 17:05:35 +02:00
DnsNameResolverClientSubnetTest.java DNS Resovler tests should be more explicit about ndots 2017-07-12 15:49:45 -07:00
DnsNameResolverTest.java Add cache for CNAME mappings resolved during lookup of DNS entries. (#8314) 2018-09-27 17:05:35 +02:00
DnsServerAddressesTest.java DNS move JDK DNS resolution out of DnsServerAddresses static initialization 2017-04-06 18:09:58 -07:00
NameServerComparatorTest.java Correctly handle DNS redirects for NS servers that have no ADDITIONAL record (#8177) 2018-08-22 17:49:22 +02:00
SearchDomainTest.java Fix typos in docs. 2018-02-14 08:44:07 +01:00
TestDnsServer.java Correctly handle DNS redirects for NS servers that have no ADDITIONAL record (#8177) 2018-08-22 17:49:22 +02:00
UnixResolverDnsServerAddressStreamProviderTest.java Fixed illegal reflective access by not relying on a sun.net.dns class. (#8318) (#8319) 2018-09-26 20:55:46 +02:00