1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-19 02:46:33 -05:00
v2fly/app/dns/config.go
Darien Raymond 59a1e2d736
refactor
2017-04-23 19:16:56 +02:00

21 lines
432 B
Go

package dns
import (
"net"
"v2ray.com/core/app/log"
)
func (c *Config) GetInternalHosts() map[string]net.IP {
hosts := make(map[string]net.IP)
for domain, ipOrDomain := range c.GetHosts() {
address := ipOrDomain.AsAddress()
if address.Family().IsDomain() {
log.Trace(newError("ignoring domain address in static hosts: ", address.Domain()).AtWarning())
continue
}
hosts[domain] = address.IP()
}
return hosts
}