From d0f4170e3584cbb48afef82af323e722b7fb5c7f Mon Sep 17 00:00:00 2001 From: bigeagle Date: Tue, 3 Feb 2015 23:20:36 +0800 Subject: [PATCH] only cache successful lookups --- handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handler.go b/handler.go index 8585670..b3fd57c 100644 --- a/handler.go +++ b/handler.go @@ -147,7 +147,7 @@ func (h *GODNSHandler) do(Net string, w dns.ResponseWriter, req *dns.Msg) { w.WriteMsg(mesg) - if IPQuery > 0 { + if IPQuery > 0 && len(mesg.Answer) > 0 { err = h.cache.Set(key, mesg) if err != nil {