diff options
Diffstat (limited to 'plugin/cache/item.go')
-rw-r--r-- | plugin/cache/item.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/plugin/cache/item.go b/plugin/cache/item.go index 3943ff4ae..55d618a39 100644 --- a/plugin/cache/item.go +++ b/plugin/cache/item.go @@ -95,6 +95,11 @@ func minMsgTTL(m *dns.Msg, mt response.Type) time.Duration { return 0 } + // No data to examine, return a short ttl as a fail safe. + if len(m.Answer)+len(m.Ns) == 0 { + return failSafeTTL + } + minTTL := maxTTL for _, r := range append(m.Answer, m.Ns...) { switch mt { |