mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-26 21:24:14 +00:00
DNS hosts: Support return RCode
This commit is contained in:
parent
fbae89d017
commit
74fa9b972f
4 changed files with 70 additions and 19 deletions
|
@ -204,7 +204,9 @@ func (s *DNS) LookupIP(domain string, option dns.IPOption) ([]net.IP, uint32, er
|
|||
}
|
||||
|
||||
// Static host lookup
|
||||
switch addrs := s.hosts.Lookup(domain, option); {
|
||||
switch addrs, err := s.hosts.Lookup(domain, option); {
|
||||
case err != nil:
|
||||
return nil, 0, err
|
||||
case addrs == nil: // Domain not recorded in static host
|
||||
break
|
||||
case len(addrs) == 0: // Domain recorded, but no valid IP returned (e.g. IPv4 address with only IPv6 enabled)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue