Documentation
¶
Overview ¶
Read system DNS config, support windows, macosx and linux. Code is mainly from golang standard net package. main changes: 1. make DnsConfig publicly accessible 2. remove unnecessary status
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultResolvFile = "/etc/resolv.conf"
)
Functions ¶
This section is empty.
Types ¶
type DnsConfig ¶
type DnsConfig struct { Servers []string // server addresses (in host:port form) to use Search []string // rooted suffixes to append to local name Ndots int // number of dots in name to trigger absolute lookup Timeout time.Duration // wait before giving up on a query, including retries Attempts int // lost packets before giving up on server Rotate bool // round robin among servers UnknownOpt bool // anything unknown was encountered Lookup []string // OpenBSD top-level database "lookup" order Err error // any error that occurs during open of resolv.conf Mtime time.Time // time of resolv.conf modification SingleRequest bool // use sequential A and AAAA queries instead of parallel queries UseTCP bool // force usage of TCP for DNS resolutions TrustAD bool // add AD flag to queries NoReload bool // do not check for config file updates }
func ReadDnsConfig ¶
func ReadDnsConfig() *DnsConfig
Click to show internal directories.
Click to hide internal directories.