Windows: Don't pull in all of resolvconf
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
parent
2c617078a7
commit
d255187be4
2 changed files with 18 additions and 10 deletions
16
resolvconf/dns/resolvconf.go
Normal file
16
resolvconf/dns/resolvconf.go
Normal file
|
@ -0,0 +1,16 @@
|
|||
package dns
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
)
|
||||
|
||||
const IpLocalhost = `((127\.([0-9]{1,3}.){2}[0-9]{1,3})|(::1))`
|
||||
|
||||
var localhostIPRegexp = regexp.MustCompile(IpLocalhost)
|
||||
|
||||
// IsLocalhost returns true if ip matches the localhost IP regular expression.
|
||||
// Used for determining if nameserver settings are being passed which are
|
||||
// localhost addresses
|
||||
func IsLocalhost(ip string) bool {
|
||||
return localhostIPRegexp.MatchString(ip)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue