Fix processing empty dns result

This commit is contained in:
世界 2022-09-10 14:15:04 +08:00
parent 2ae4da524e
commit 80cfc9a25b
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -82,6 +82,9 @@ func (r *Router) Lookup(ctx context.Context, domain string, strategy dns.DomainS
r.dnsLogger.InfoContext(ctx, "lookup succeed for ", domain, ": ", strings.Join(F.MapToString(addrs), " "))
} else {
r.dnsLogger.ErrorContext(ctx, E.Cause(err, "lookup failed for ", domain))
if err == nil {
err = dns.RCodeNameError
}
}
return addrs, err
}