dns

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Nameservers are the IP addresses of the nameservers to use.
	Nameservers []netaddr.IP
	// Domains are the search domains to use.
	Domains []string
	// PerDomain indicates whether it is preferred to use Nameservers
	// only for DNS queries for subdomains of Domains.
	// Note that Nameservers may still be applied to all queries
	// if the manager does not support per-domain settings.
	PerDomain bool
	// Proxied indicates whether DNS requests are proxied through a tsdns.Resolver.
	// This enables Magic DNS.
	Proxied bool
}

Config is the set of parameters that uniquely determine the state to which a manager should bring system DNS settings.

func (Config) Equal

func (lhs Config) Equal(rhs Config) bool

Equal determines whether its argument and receiver represent equivalent DNS configurations (then DNS reconfig is a no-op).

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manages system DNS settings.

func NewManager

func NewManager(mconfig ManagerConfig) *Manager

NewManagers created a new manager from the given config.

func (*Manager) Down

func (m *Manager) Down() error

func (*Manager) Set

func (m *Manager) Set(config Config) error

func (*Manager) Up

func (m *Manager) Up() error

type ManagerConfig

type ManagerConfig struct {
	// Logf is the logger for the manager to use.
	// It is wrapped with a "dns: " prefix.
	Logf logger.Logf
	// InterfaceName is the name of the interface with which DNS settings should be associated.
	InterfaceName string
	// Cleanup indicates that the manager is created for cleanup only.
	// A no-op manager will be instantiated if the system needs no cleanup.
	Cleanup bool
	// PerDomain indicates that a manager capable of per-domain configuration is preferred.
	// Certain managers are per-domain only; they will not be considered if this is false.
	PerDomain bool
}

ManagerConfig is the set of parameters from which a manager implementation is chosen and initialized.

Jump to

Keyboard shortcuts

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