Documentation ¶
Index ¶
- func Build(path string, dns, dnsSearch []string) error
- func Get() ([]byte, error)
- func GetIfChanged() ([]byte, string, error)
- func GetLastModified() ([]byte, string)
- func GetNameservers(resolvConf []byte) []string
- func GetNameserversAsCIDR(resolvConf []byte) []string
- func GetSearchDomains(resolvConf []byte) []string
- func RemoveReplaceLocalDns(resolvConf []byte) ([]byte, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetIfChanged ¶
Retrieves the host /etc/resolv.conf file, checks against the last hash and, if modified since last check, returns the bytes and new hash. This feature is used by the resolv.conf updater for containers
func GetLastModified ¶
retrieve the last used contents and hash of the host resolv.conf Used by containers updating on restart
func GetNameservers ¶
GetNameservers returns nameservers (if any) listed in /etc/resolv.conf
func GetNameserversAsCIDR ¶
GetNameserversAsCIDR returns nameservers (if any) listed in /etc/resolv.conf as CIDR blocks (e.g., "1.2.3.4/32") This function's output is intended for net.ParseCIDR
func GetSearchDomains ¶
GetSearchDomains returns search domains (if any) listed in /etc/resolv.conf If more than one search line is encountered, only the contents of the last one is returned.
func RemoveReplaceLocalDns ¶
RemoveReplaceLocalDns looks for localhost (127.*) entries in the provided resolv.conf, removing local nameserver entries, and, if the resulting cleaned config has no defined nameservers left, adds default DNS entries It also returns a boolean to notify the caller if changes were made at all
Types ¶
This section is empty.