mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-04 17:27:23 -05:00
21 lines
420 B
Go
21 lines
420 B
Go
package dns
|
|
|
|
import (
|
|
"net"
|
|
|
|
"v2ray.com/core/common/log"
|
|
)
|
|
|
|
func (v *Config) GetInternalHosts() map[string]net.IP {
|
|
hosts := make(map[string]net.IP)
|
|
for domain, ipOrDomain := range v.GetHosts() {
|
|
address := ipOrDomain.AsAddress()
|
|
if address.Family().IsDomain() {
|
|
log.Warning("DNS: Ignoring domain address in static hosts: ", address.Domain())
|
|
continue
|
|
}
|
|
hosts[domain] = address.IP()
|
|
}
|
|
return hosts
|
|
}
|