CoreDNS Plugin: Asynchronous Distributed Cache for Distributed System.
dcache - enables a networked async cache using Redis Pub/Sub.
dcache is a [d]istributed [cache] plugin.
Using dcache, you can use Redis Pub/Sub to asynchronously share name resolution resolved by other nodes. This means that DNS queries do not use unnecessary communication to retrieve the cache, and it operates with very low latency. It can be used in conjunction with the CoreDNS standard cache plug-in. The TTL of the cache is the smallest value in the response.
If this plugin is enabled and you cannot connect to Redis, it does nothing and does not interfere with CoreDNS operation.
redisc takes the data to Redis after a DNS query, but dcache uses Pub/Sub to keep the cache data in memory asynchronously.
dcache provides better latency than redisc in environments with very large DNS queries such as crawling.
all zone enable dcache.
. {
forward . 1.1.1.1
cache
dcache example.org:6379
}
dcache [Redishost]:[Port]
If monitoring is enabled (via the prometheus directive) then the following metrics are exported:
coredns_dcache_hits_total{server}
- Counter of cache hits.coredns_dcache_misses_total{server}
- Counter of cache misses.coredns_dcache_redis_errors_total{server}
- Counter of errors when connecting to Redis.coredns_dcache_discard_cache_total{server}
- Counter of data that failed deserialization.