DNS: Support returning upstream TTL to clients (#4526)
Closes https://github.com/XTLS/Xray-core/issues/4527
This commit is contained in:
1 parent
2d3210e4b8
commit
4afe2d0cff
24 files changed
+168
-157
No files matched your search
@@ -90,13 +90,13 @@ func lookupIP(domain string, strategy DomainStrategy, localAddr net.Address) ([]
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
ips, err := dnsClient.LookupIP(domain, dns.IPOption{
|
||||
ips, _, err := dnsClient.LookupIP(domain, dns.IPOption{
|
||||
IPv4Enable: (localAddr == nil || localAddr.Family().IsIPv4()) && strategy.preferIP4(),
|
||||
IPv6Enable: (localAddr == nil || localAddr.Family().IsIPv6()) && strategy.preferIP6(),
|
||||
})
|
||||
{ // Resolve fallback
|
||||
if (len(ips) == 0 || err != nil) && strategy.hasFallback() && localAddr == nil {
|
||||
ips, err = dnsClient.LookupIP(domain, dns.IPOption{
|
||||
ips, _, err = dnsClient.LookupIP(domain, dns.IPOption{
|
||||
IPv4Enable: strategy.fallbackIP4(),
|
||||
IPv6Enable: strategy.fallbackIP6(),
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user