This commit is contained in:
parent
0c1b4738cd
commit
fde6624777
@ -45,11 +45,18 @@ func (r *Resolver) Lookup(net string, req *dns.Msg) (message *dns.Msg, err error
|
||||
logger.Warn("error:%s", err.Error())
|
||||
return
|
||||
}
|
||||
// If SERVFAIL happen, should return immediately and try another upstream resolver.
|
||||
// However, other Error code like NXDOMAIN is an clear response stating
|
||||
// that it has been verified no such domain existas and ask other resolvers
|
||||
// would make no sense. See more about #20
|
||||
if r != nil && r.Rcode != dns.RcodeSuccess {
|
||||
logger.Warn("%s failed to get an valid answer on %s", qname, nameserver)
|
||||
if r.Rcode == dns.RcodeServerFailure {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
logger.Debug("%s resolv on %s (%s) ttl: %d", UnFqdn(qname), nameserver, net, rtt)
|
||||
}
|
||||
select {
|
||||
case res <- r:
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user