dnsconfig

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Location = "/etc/resolv.conf"

Location is the location of the system DNS configuration.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config 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.
	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
	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
}

Config is the system DNS configuration.

func Read

func Read(filename string) (*Config, error)

Read reads the system DNS config from /etc/resolv.conf. See resolv.conf(5) on a Linux machine.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL