From db5719e22fac3ec80d5aabf3647b76f89e48703a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 20 Aug 2024 23:17:02 +0800 Subject: [PATCH] Fix no error return when empty DNS cache retrieved --- route/router_dns.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/route/router_dns.go b/route/router_dns.go index a8c4f441..e0055009 100644 --- a/route/router_dns.go +++ b/route/router_dns.go @@ -188,6 +188,9 @@ func (r *Router) Lookup(ctx context.Context, domain string, strategy dns.DomainS ) responseAddrs, cached = r.dnsClient.LookupCache(ctx, domain, strategy) if cached { + if len(responseAddrs) == 0 { + return nil, dns.RCodeNameError + } return responseAddrs, nil } r.dnsLogger.DebugContext(ctx, "lookup domain ", domain)