瀏覽代碼

Fix no error return when empty DNS cache retrieved

世界 1 年之前
父節點
當前提交
db5719e22f
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      route/router_dns.go

+ 3 - 0
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)