commit 590fd1b7ff6f75bd5afaea2e2db06d8063841c17 from: Oliver Lowe date: Sat Dec 18 04:08:54 2021 UTC cmd/recursor: comments on caching records With an explanation of why we lookup before we insert into the cache commit - b141f1193309066d69c8a1759da0d6cf4d6d60b7 commit + 590fd1b7ff6f75bd5afaea2e2db06d8063841c17 blob - a357cbedc5c26b689636d6572573aaa08d48b2cb blob + fc31993872bcb976e731fab525902ed6d61cd4f1 --- cmd/recursor/resolve.go +++ cmd/recursor/resolve.go @@ -88,6 +88,8 @@ func resolve(q dnsmessage.Question, next []net.IP, dep } fmt.Println("no auth answer") + // cache resource records from authorities, additionals sections if we + // don't have them already (i.e. from authoritative answers) if len(rmsg.Authorities) > 0 { if _, ok := lookup(rmsg.Authorities[0].Header.Name, rmsg.Authorities[0].Header.Type); !ok { insert(rmsg.Authorities[0].Header.Name, rmsg.Authorities[0].Header.Type, rmsg.Authorities)