ffdns

package
v1.6.7 Latest Latest
Warning

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

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

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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