From 80cfc9a25b04a2f22428ee178fed3fbb9c40288e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sat, 10 Sep 2022 14:15:04 +0800 Subject: [PATCH] Fix processing empty dns result --- route/router_dns.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/route/router_dns.go b/route/router_dns.go index 373d5dc9..a1bab409 100644 --- a/route/router_dns.go +++ b/route/router_dns.go @@ -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 }