nameserver

package
v2.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UseDNSInternally

func UseDNSInternally(settings SettingsInternalDNS)

UseDNSInternally changes the Go program DNS only.

func UseDNSSystemWide

func UseDNSSystemWide(settings SettingsSystemDNS) (err error)

UseDNSSystemWide changes the nameserver to use for DNS system wide. If resolvConfPath is empty, it defaults to /etc/resolv.conf.

Types

type SettingsInternalDNS

type SettingsInternalDNS struct {
	// IP is the IP address to use for the DNS.
	// It defaults to 127.0.0.1 if nil.
	IP netip.Addr
	// Port is the port to reach the DNS server on.
	// It defaults to 53 if left unset.
	Port uint16
	// Timeout is the dialer timeout. By default there is
	// no timeout.
	Timeout time.Duration
}

func (*SettingsInternalDNS) SetDefaults

func (s *SettingsInternalDNS) SetDefaults()

func (SettingsInternalDNS) Validate

func (s SettingsInternalDNS) Validate() (err error)

type SettingsSystemDNS

type SettingsSystemDNS struct {
	// IP is the IP address to use for the DNS.
	// It defaults to 127.0.0.1 if nil.
	IP netip.Addr
	// ResolvPath is the path to the resolv configuration file.
	// It defaults to /etc/resolv.conf.
	ResolvPath string
	// KeepNameserver can be set to preserve existing nameserver lines
	// in the resolv configuration file.
	KeepNameserver bool
}

func (*SettingsSystemDNS) SetDefaults

func (s *SettingsSystemDNS) SetDefaults()

func (*SettingsSystemDNS) Validate

func (s *SettingsSystemDNS) Validate() (err error)

Jump to

Keyboard shortcuts

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