ffdns

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Servers an optional list of DNS server addresses (host or host:port, port defaults
	// to 53). Setting this forces use of Go's built-in resolver.
	DNSServers = "servers"
	// Timeout the dial timeout when contacting a configured DNS server
	DNSTimeout = "timeout"
)

Variables

This section is empty.

Functions

func EnableResolverMetrics

func EnableResolverMetrics(ctx context.Context, metricsRegistry metric.MetricsRegistry)

func InitConfig

func InitConfig(conf config.Section)

func NewResolver

func NewResolver(config config.Section) *net.Resolver

NewDNSResolver builds a pure-Go *net.Resolver for metrics instructmentation, custom timeouts, and/or custom servers. The resolver will dial the given DNS servers (each host or host:port, port defaulting to 53) in order, failing over to the next on error. Returns nil if none of the customizations (metrics, timeout, or servers) are enabeld. Exported so non-ffresty dialers — e.g. a WebSocket dialer — can honour the same DNS config as the HTTP client.

func NewResolverWithConfig

func NewResolverWithConfig(cfg *Config) *net.Resolver

Types

type Config

type Config struct {
	Servers []string
	Timeout time.Duration
}

func GenerateConfig

func GenerateConfig(conf config.Section) (*Config, error)

Jump to

Keyboard shortcuts

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