Fix no error return when empty DNS cache retrieved

This commit is contained in:
世界 2024-08-20 23:17:02 +08:00
parent 064fb9b873
commit db5719e22f
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4

View File

@ -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)