diff --git a/dns/middleware.go b/dns/middleware.go index 1b9198bd..edc42c42 100644 --- a/dns/middleware.go +++ b/dns/middleware.go @@ -19,7 +19,7 @@ func withFakeIP(cache *cache.Cache, pool *fakeip.Pool) handler { q := r.Question[0] cacheItem := cache.Get("fakeip:" + q.String()) - if cache != nil { + if cacheItem != nil { msg := cacheItem.(*D.Msg).Copy() setMsgTTL(msg, 1) msg.SetReply(r)