aboutsummaryrefslogtreecommitdiff
path: root/plugin/cache/cache.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/cache/cache.go')
-rw-r--r--plugin/cache/cache.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugin/cache/cache.go b/plugin/cache/cache.go
index 6b50c51cc..9988d9c70 100644
--- a/plugin/cache/cache.go
+++ b/plugin/cache/cache.go
@@ -210,6 +210,10 @@ func (w *ResponseWriter) set(m *dns.Msg, key uint64, mt response.Type, duration
case response.NoError, response.Delegation:
i := newItem(m, w.now(), duration)
w.pcache.Add(key, i)
+ // when pre-fetching, remove the negative cache entry if it exists
+ if w.prefetch {
+ w.ncache.Remove(key)
+ }
case response.NameError, response.NoData, response.ServerError:
i := newItem(m, w.now(), duration)