dnsx

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package dnsx is the DNS interface every lookup in lfr goes through, so tests run against a fake zone and production gets timeouts and an optional fixed resolver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NotFound

func NotFound(err error) bool

NotFound reports whether err means the name or record does not exist, as opposed to a temporary failure.

Types

type Resolver

type Resolver interface {
	LookupTXT(ctx context.Context, name string) ([]string, error)
	LookupMX(ctx context.Context, name string) ([]*net.MX, error)
	LookupIPAddr(ctx context.Context, host string) ([]net.IPAddr, error)
	LookupAddr(ctx context.Context, addr string) ([]string, error)
	LookupCNAME(ctx context.Context, host string) (string, error)
}

Resolver is the subset of net.Resolver lfr uses.

func System

func System(server string, timeout time.Duration) Resolver

System returns the system resolver with a per-query timeout. When server is set ("1.1.1.1:53"), queries go there instead of /etc/resolv.conf.

Directories

Path Synopsis
Package dnsxtest is an in-memory DNS zone for tests.
Package dnsxtest is an in-memory DNS zone for tests.

Jump to

Keyboard shortcuts

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