1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-02-20 23:47:21 -05:00
v2fly/app/dns/config.go

19 lines
407 B
Go
Raw Normal View History

2016-05-16 00:25:34 -07:00
package dns
2015-12-06 11:00:10 +01:00
2016-01-15 15:23:12 +01:00
import (
2016-05-22 22:30:08 +02:00
"net"
2016-01-15 15:23:12 +01:00
)
2017-04-23 19:16:56 +02:00
func (c *Config) GetInternalHosts() map[string]net.IP {
2016-09-20 16:05:35 +02:00
hosts := make(map[string]net.IP)
2017-04-23 19:16:56 +02:00
for domain, ipOrDomain := range c.GetHosts() {
2016-10-12 18:43:55 +02:00
address := ipOrDomain.AsAddress()
2016-09-20 16:05:35 +02:00
if address.Family().IsDomain() {
2017-12-19 21:28:12 +01:00
newError("ignoring domain address in static hosts: ", address.Domain()).AtWarning().WriteToLog()
2016-09-20 16:05:35 +02:00
continue
}
hosts[domain] = address.IP()
}
return hosts
2015-12-06 11:00:10 +01:00
}