mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-04-04 20:37:37 +03:00
Make domain_resolver
optional when only one DNS server is configured
This commit is contained in:
parent
f46df03695
commit
06f25876b3
4 changed files with 22 additions and 2 deletions
|
@ -104,7 +104,12 @@ func NewWithOptions(options Options) (N.Dialer, error) {
|
|||
} else if options.NewDialer {
|
||||
return nil, E.New("missing domain resolver for domain server address")
|
||||
} else {
|
||||
deprecated.Report(options.Context, deprecated.OptionMissingDomainResolver)
|
||||
transports := dnsTransport.Transports()
|
||||
if len(transports) < 2 {
|
||||
dnsQueryOptions.Transport = dnsTransport.Default()
|
||||
} else {
|
||||
deprecated.Report(options.Context, deprecated.OptionMissingDomainResolver)
|
||||
}
|
||||
}
|
||||
dialer = NewResolveDialer(
|
||||
options.Context,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue