diff options
Diffstat (limited to 'plugin/cache/handler.go')
-rw-r--r-- | plugin/cache/handler.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/plugin/cache/handler.go b/plugin/cache/handler.go index e60637af8..de7cae456 100644 --- a/plugin/cache/handler.go +++ b/plugin/cache/handler.go @@ -71,6 +71,11 @@ func (c *Cache) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) }) } + if c.keepttl { + // If keepttl is enabled we fake the current time to the stored + // one so that we always get the original TTL + now = i.stored + } resp := i.toMsg(r, now, do, ad) w.WriteMsg(resp) return dns.RcodeSuccess, nil |