mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-18 10:26:01 -05:00
19 lines
407 B
Go
19 lines
407 B
Go
package dns
|
|
|
|
import (
|
|
"net"
|
|
)
|
|
|
|
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() {
|
|
newError("ignoring domain address in static hosts: ", address.Domain()).AtWarning().WriteToLog()
|
|
continue
|
|
}
|
|
hosts[domain] = address.IP()
|
|
}
|
|
return hosts
|
|
}
|