mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
417 B
21 lines
417 B
package dns
|
|
|
|
import (
|
|
"net"
|
|
|
|
"v2ray.com/core/app/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
|
|
}
|