Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrResolvPathIsDirectory = errors.New("resolv path is a directory")
Functions ¶
func GetDNSServers ¶
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 }
func (*SettingsSystemDNS) SetDefaults ¶
func (s *SettingsSystemDNS) SetDefaults()
func (*SettingsSystemDNS) Validate ¶
func (s *SettingsSystemDNS) Validate() (err error)
Click to show internal directories.
Click to hide internal directories.