only cache successful lookups

This commit is contained in:
bigeagle 2015-02-03 23:20:36 +08:00
parent ccb72deec7
commit d0f4170e35
1 changed files with 1 additions and 1 deletions

View File

@ -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 {