1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-07-01 03:25:23 +00:00
v2fly/app/dns/config.go

21 lines
424 B
Go
Raw Normal View History

2016-05-16 07:25:34 +00:00
package dns
2015-12-06 10:00:10 +00:00
2016-01-15 14:23:12 +00:00
import (
2016-05-22 20:30:08 +00:00
"net"
2016-09-20 14:05:35 +00:00
"v2ray.com/core/common/log"
2016-01-15 14:23:12 +00:00
)
2016-09-20 14:05:35 +00:00
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
2015-12-06 10:00:10 +00:00
}