netty5/resolver-dns/src/main/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
..
AuthoritativeDnsServerCache.java Correctly handle DNS redirects for NS servers that have no ADDITIONAL record (#8177) 2018-08-22 17:49:22 +02:00
AuthoritativeDnsServerCacheAdapter.java Correctly handle DNS redirects for NS servers that have no ADDITIONAL record (#8177) 2018-08-22 17:49:22 +02:00
BiDnsQueryLifecycleObserver.java Replace DnsNameResolverContext#trace special code with an implementation of DnsQueryLifecycleObserver 2017-06-23 09:04:59 -07:00
BiDnsQueryLifecycleObserverFactory.java Replace DnsNameResolverContext#trace special code with an implementation of DnsQueryLifecycleObserver 2017-06-23 09:04:59 -07:00
Cache.java Correctly handle DNS redirects for NS servers that have no ADDITIONAL record (#8177) 2018-08-22 17:49:22 +02:00
DefaultAuthoritativeDnsServerCache.java Correctly handle DNS redirects for NS servers that have no ADDITIONAL record (#8177) 2018-08-22 17:49:22 +02:00
DefaultDnsCache.java Correctly handle DNS redirects for NS servers that have no ADDITIONAL record (#8177) 2018-08-22 17:49:22 +02:00
DefaultDnsCnameCache.java Add cache for CNAME mappings resolved during lookup of DNS entries. (#8314) 2018-09-27 17:05:35 +02:00
DefaultDnsServerAddresses.java Correctly handle DNS redirects for NS servers that have no ADDITIONAL record (#8177) 2018-08-22 17:49:22 +02:00
DefaultDnsServerAddressStreamProvider.java Correctly handle DNS redirects for NS servers that have no ADDITIONAL record (#8177) 2018-08-22 17:49:22 +02:00
DnsAddressDecoder.java Add DnsNameResolver.resolveAll(DnsQuestion) (#7803) 2018-03-29 22:01:25 +02:00
DnsAddressResolveContext.java Correctly handle DNS redirects for NS servers that have no ADDITIONAL record (#8177) 2018-08-22 17:49:22 +02:00
DnsAddressResolverGroup.java DnsAddressResolverGroup to use pluggable DnsNameResolverBuilder (#7793) 2018-04-26 08:04:01 +02:00
DnsCache.java Allow to detect failed query caused by an Timeout / IO error and also not cache these. 2017-11-23 10:56:41 +01:00
DnsCacheEntry.java Decouple DnsCache and DnsCacheEntry 2017-08-21 11:15:27 -07:00
DnsCnameCache.java Add cache for CNAME mappings resolved during lookup of DNS entries. (#8314) 2018-09-27 17:05:35 +02:00
DnsNameResolver.java Add cache for CNAME mappings resolved during lookup of DNS entries. (#8314) 2018-09-27 17:05:35 +02:00
DnsNameResolverBuilder.java Add cache for CNAME mappings resolved during lookup of DNS entries. (#8314) 2018-09-27 17:05:35 +02:00
DnsNameResolverException.java Allow to detect failed query caused by an Timeout / IO error and also not cache these. 2017-11-23 10:56:41 +01:00
DnsNameResolverTimeoutException.java Allow to detect failed query caused by an Timeout / IO error and also not cache these. 2017-11-23 10:56:41 +01:00
DnsQueryContext.java Remove id from DnsQueryContextManager whenever the promise is fullfilled. 2018-06-27 10:20:59 +02:00
DnsQueryContextManager.java fix the typos 2017-04-20 04:56:09 +02:00
DnsQueryLifecycleObserver.java DNS Resolver visibility into individual queries 2017-04-27 15:17:20 -07:00
DnsQueryLifecycleObserverFactory.java DNS Resolver visibility into individual queries 2017-04-27 15:17:20 -07:00
DnsRecordResolveContext.java Always follow cnames even if a matching A or AAAA record was found. (#7919) 2018-05-09 13:48:20 +02:00
DnsResolveContext.java Add cache for CNAME mappings resolved during lookup of DNS entries. (#8314) 2018-09-27 17:05:35 +02:00
DnsServerAddresses.java Correctly handle DNS redirects for NS servers that have no ADDITIONAL record (#8177) 2018-08-22 17:49:22 +02:00
DnsServerAddressStream.java DNS Resolver should be more consistent with JDK resolution 2017-07-05 09:10:59 -04:00
DnsServerAddressStreamProvider.java DNS Resolve ambiguity in which DNS servers are used during resolution 2017-03-31 15:29:49 -07:00
DnsServerAddressStreamProviders.java Don't try to use UnixResolverDnsServerAddressStreamProvider when on Windows. 2017-11-13 20:26:38 +01:00
InflightNameResolver.java Do not send duplicate DNS queries when the same query is in progress already 2016-05-17 15:07:36 +02:00
MultiDnsServerAddressStreamProvider.java DNS Resolve ambiguity in which DNS servers are used during resolution 2017-03-31 15:29:49 -07:00
NameServerComparator.java Correctly handle DNS redirects for NS servers that have no ADDITIONAL record (#8177) 2018-08-22 17:49:22 +02:00
NoopAuthoritativeDnsServerCache.java Correctly handle DNS redirects for NS servers that have no ADDITIONAL record (#8177) 2018-08-22 17:49:22 +02:00
NoopDnsCache.java Decouple DnsCache and DnsCacheEntry 2017-08-21 11:15:27 -07:00
NoopDnsCnameCache.java Add cache for CNAME mappings resolved during lookup of DNS entries. (#8314) 2018-09-27 17:05:35 +02:00
NoopDnsQueryLifecycleObserver.java DNS Resolver visibility into individual queries 2017-04-27 15:17:20 -07:00
NoopDnsQueryLifecycleObserverFactory.java DNS Resolver visibility into individual queries 2017-04-27 15:17:20 -07:00
package-info.java [#5088] Add annotation which marks packages/interfaces/classes as unstable 2016-05-09 15:16:35 +02:00
RotationalDnsServerAddresses.java Correctly handle DNS redirects for NS servers that have no ADDITIONAL record (#8177) 2018-08-22 17:49:22 +02:00
RoundRobinDnsAddressResolverGroup.java DnsAddressResolverGroup to use pluggable DnsNameResolverBuilder (#7793) 2018-04-26 08:04:01 +02:00
SequentialDnsServerAddressStream.java Correctly handle DNS redirects for NS servers that have no ADDITIONAL record (#8177) 2018-08-22 17:49:22 +02:00
SequentialDnsServerAddressStreamProvider.java DNS Resolver should be more consistent with JDK resolution 2017-07-05 09:10:59 -04:00
ShuffledDnsServerAddressStream.java Correctly handle DNS redirects for NS servers that have no ADDITIONAL record (#8177) 2018-08-22 17:49:22 +02:00
SingletonDnsServerAddresses.java DNS Resolver should be more consistent with JDK resolution 2017-07-05 09:10:59 -04:00
SingletonDnsServerAddressStreamProvider.java DNS Resolver should be more consistent with JDK resolution 2017-07-05 09:10:59 -04:00
TraceDnsQueryLifecycleObserver.java Replace DnsNameResolverContext#trace special code with an implementation of DnsQueryLifecycleObserver 2017-06-23 09:04:59 -07:00
TraceDnsQueryLifeCycleObserverFactory.java Replace DnsNameResolverContext#trace special code with an implementation of DnsQueryLifecycleObserver 2017-06-23 09:04:59 -07:00
UniSequentialDnsServerAddressStreamProvider.java DNS Resolver should be more consistent with JDK resolution 2017-07-05 09:10:59 -04:00
UnixResolverDnsServerAddressStreamProvider.java Fixed illegal reflective access by not relying on a sun.net.dns class. (#8318) (#8319) 2018-09-26 20:55:46 +02:00