mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-25 18:11:28 +00:00
Fix dns log
This commit is contained in:
parent
fbaa2f9de9
commit
5a1ddea100
|
@ -133,11 +133,11 @@ func (r *Router) Lookup(ctx context.Context, domain string, strategy dns.DomainS
|
||||||
addrs, err := r.dnsClient.Lookup(ctx, transport, domain, strategy)
|
addrs, err := r.dnsClient.Lookup(ctx, transport, domain, strategy)
|
||||||
if len(addrs) > 0 {
|
if len(addrs) > 0 {
|
||||||
r.dnsLogger.InfoContext(ctx, "lookup succeed for ", domain, ": ", strings.Join(F.MapToString(addrs), " "))
|
r.dnsLogger.InfoContext(ctx, "lookup succeed for ", domain, ": ", strings.Join(F.MapToString(addrs), " "))
|
||||||
} else {
|
} else if err != nil {
|
||||||
r.dnsLogger.ErrorContext(ctx, E.Cause(err, "lookup failed for ", domain))
|
r.dnsLogger.ErrorContext(ctx, E.Cause(err, "lookup failed for ", domain))
|
||||||
if err == nil {
|
} else {
|
||||||
err = dns.RCodeNameError
|
r.dnsLogger.ErrorContext(ctx, "lookup failed for ", domain, ": empty result")
|
||||||
}
|
err = dns.RCodeNameError
|
||||||
}
|
}
|
||||||
return addrs, err
|
return addrs, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue