mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-05 19:58:41 +00:00
Refine DNS Options
This commit is contained in:
parent
f20c445974
commit
217844cc37
10 changed files with 82 additions and 55 deletions
|
@ -63,17 +63,17 @@ func (d *DefaultSystemDialer) lookupIP(domain string, strategy DomainStrategy, l
|
|||
return nil, nil
|
||||
}
|
||||
|
||||
var opt = dns.LookupIP
|
||||
var opt dns.Option
|
||||
switch {
|
||||
case strategy == DomainStrategy_USE_IP4 || (localAddr != nil && localAddr.Family().IsIPv4()):
|
||||
opt = dns.LookupIPv4
|
||||
opt = dns.LookupIPv4Only
|
||||
case strategy == DomainStrategy_USE_IP6 || (localAddr != nil && localAddr.Family().IsIPv6()):
|
||||
opt = dns.LookupIPv6
|
||||
opt = dns.LookupIPv6Only
|
||||
case strategy == DomainStrategy_AS_IS:
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return d.dns.LookupOptions(domain, opt)
|
||||
return d.dns.LookupOptions(domain, opt, dns.LookupNoFake)
|
||||
}
|
||||
|
||||
func (d *DefaultSystemDialer) canLookupIP(ctx context.Context, dst net.Destination, sockopt *SocketConfig) bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue