修复DNS逻辑错误的问题

This commit is contained in:
CN-JS-HuiBai
2026-04-16 21:40:39 +08:00
parent 830944682f
commit 95b664a772
9 changed files with 1700 additions and 6 deletions

View File

@@ -792,9 +792,15 @@ func (r *Router) actionResolve(ctx context.Context, metadata *adapter.InboundCon
if metadata.Destination.IsDomain() {
var transport adapter.DNSTransport
if action.Server != "" {
var loaded bool
transport, loaded = r.dnsTransport.Transport(action.Server)
var (
loaded bool
ambiguous bool
)
transport, loaded, ambiguous = adapter.LookupDNSTransport(r.dnsTransport, action.Server)
if !loaded {
if ambiguous {
return E.New("DNS server is ambiguous: ", action.Server)
}
return E.New("DNS server not found: ", action.Server)
}
}