dnsclient

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildQueries

func BuildQueries(config Config) ([]dns.Msg, error)

BuildQueries constructs one q-compatible DNS message per requested RR type.

func BuildTLSConfig

func BuildTLSConfig(opts cli.Flags) (*tls.Config, func() error, error)

BuildTLSConfig creates the TLS configuration expected by q transports. The returned cleanup closes the optional TLS key-log file and is always non-nil.

func NewTransport

func NewTransport(server ParsedServer, opts cli.Flags, tlsConfig *tls.Config) (qtransport.Transport, error)

NewTransport creates a q public transport from a normalized server and q flags. Inputs known to trigger log.Fatal inside q are rejected where they can be validated without performing the query itself.

func Run

func Run(ctx context.Context, args []string, stdout, stderr io.Writer) int

Run executes q-compatible DNS client arguments. It is intentionally scoped to NextTrace's exclusive full-flavor terminal mode.

Types

type Config

type Config struct {
	Flags               cli.Flags
	RRTypes             []uint16
	Warnings            []string
	EarlyDebugMessages  []string
	DebugMessages       []string
	CompletionRequested bool
	CompletionVerbose   bool
	Completions         []flags.Completion
}

Config is the normalized q-compatible input consumed by the DNS runner.

func ParseConfig

func ParseConfig(args []string, parseOpts ParseOptions) (Config, error)

ParseConfig parses q arguments without terminating the process on invalid input.

type ParseOptions

type ParseOptions struct {
	StdoutIsTerminal   bool
	HomeDir            string
	LookupEnv          func(string) (string, bool)
	ResolverConfigPath string
}

ParseOptions isolates filesystem and environment input for argument parsing.

func DefaultParseOptions

func DefaultParseOptions(stdoutIsTerminal bool) ParseOptions

DefaultParseOptions returns the process-backed parsing dependencies.

type ParsedServer

type ParsedServer struct {
	Original      string
	Address       string
	TransportType qtransport.Type
	Scheme        string
	Host          string
	Port          string
	Path          string
	ServerName    string
	FromStamp     bool
}

ParsedServer is the normalized server description consumed by the q transport adapter. Address matches the server string q passes to its public transport implementations.

func ParseServer

func ParseServer(server string) (ParsedServer, error)

ParseServer normalizes q-compatible server forms, including DNS stamps, protocol URLs, host names, IPv4 addresses, and scoped IPv6 addresses.

Jump to

Keyboard shortcuts

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