dnsutil

package
v0.0.0-...-fbfc268 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TypeToString contains a mapping of DNS request type to string.
	TypeToString = dns.TypeToString

	// RcodeToString contains a mapping of Mapping DNS response code to string.
	RcodeToString = dns.RcodeToString
)

Functions

func Answers

func Answers(msg *dns.Msg) []string

Answers returns all values in the answer section of DNS message msg.

func MinTTL

func MinTTL(msg *dns.Msg) time.Duration

MinTTL returns the lowest TTL of of answer, authority and additional sections.

Types

type Client

type Client interface {
	Exchange(*dns.Msg) (*dns.Msg, error)
}

Client is the interface of a DNS client.

func NewClient

func NewClient(addr string, config Config) Client

NewClient creates a new Client for addr using config.

func NewMux

func NewMux(client ...Client) Client

NewMux creates a new multiplexed client which queries all clients in parallel and returns the first successful response.

type Config

type Config struct {
	Network string
	Timeout time.Duration
}

Config is a structure used to configure a DNS client.

Jump to

Keyboard shortcuts

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