1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-26 01:15:38 +00:00
v2fly/app/dns/config.go
2016-09-20 16:05:35 +02:00

21 lines
424 B
Go

package dns
import (
"net"
"v2ray.com/core/common/log"
)
func (this *Config) GetInternalHosts() map[string]net.IP {
hosts := make(map[string]net.IP)
for domain, addressPB := range this.GetHosts() {
address := addressPB.AsAddress()
if address.Family().IsDomain() {
log.Warning("DNS: Ignoring domain address in static hosts: ", address.Domain())
continue
}
hosts[domain] = address.IP()
}
return hosts
}