dns

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package dns contains utility functions for DNS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddServers

func AddServers(iface string, servers []netip.AddrPort) error

AddServers adds DNS servers to the system configuration. On Windows the interface name is required.

func RemoveServers

func RemoveServers(iface string, servers []netip.AddrPort) error

RemoveServers removes DNS servers from the system configuration. On Windows the interface name is required.

Types

type DNSConfig

type DNSConfig struct {
	// Servers is the list of DNS servers to use.
	Servers []string
	// Search is the list of search domains to use.
	Search []string
	// Ndots is the number of dots required for absolute name.
	Ndots int
	// Timeout is the DNS timeout.
	Timeout time.Duration
	// Attempts is the number of DNS attempts.
	Attempts int
	// UseTCP indicates whether to use TCP for DNS.
	UseTCP bool
}

DNSConfig is a configuration for performing DNS lookups.

func GetSystemConfig

func GetSystemConfig() DNSConfig

GetSystemConfig returns the system DNS configuration.

Jump to

Keyboard shortcuts

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