Add fallback local DNS server for iOS

This commit is contained in:
世界
2025-02-20 17:18:47 +08:00
parent 5c4211e849
commit 9a5f69f435
11 changed files with 293 additions and 45 deletions

View File

@@ -336,13 +336,13 @@ func (r *Router) Lookup(ctx context.Context, domain string, options adapter.DNSQ
}
} else if len(responseAddrs) == 0 {
r.logger.ErrorContext(ctx, "lookup failed for ", domain, ": empty result")
err = RCodeNameError
err = RcodeNameError
}
}
responseAddrs, cached = r.client.LookupCache(domain, options.Strategy)
if cached {
if len(responseAddrs) == 0 {
return nil, RCodeNameError
return nil, RcodeNameError
}
return responseAddrs, nil
}