dnsconfig

package module
v0.0.0-...-84960ed Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 6 Imported by: 1

README

dnsutil

Read system DNS config.

Code is mainly from golang standard net package. dnsconfig.go

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

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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