2016-05-16 03:25:34 -04:00
|
|
|
package dns
|
2015-12-06 05:00:10 -05:00
|
|
|
|
2016-01-15 09:23:12 -05:00
|
|
|
import (
|
2016-05-22 16:30:08 -04:00
|
|
|
"net"
|
|
|
|
|
2017-02-01 15:35:40 -05:00
|
|
|
"v2ray.com/core/app/log"
|
2016-01-15 09:23:12 -05:00
|
|
|
)
|
|
|
|
|
2016-11-27 11:01:44 -05:00
|
|
|
func (v *Config) GetInternalHosts() map[string]net.IP {
|
2016-09-20 10:05:35 -04:00
|
|
|
hosts := make(map[string]net.IP)
|
2016-11-27 11:01:44 -05:00
|
|
|
for domain, ipOrDomain := range v.GetHosts() {
|
2016-10-12 12:43:55 -04:00
|
|
|
address := ipOrDomain.AsAddress()
|
2016-09-20 10:05:35 -04:00
|
|
|
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 05:00:10 -05:00
|
|
|
}
|