Go-native DNS resolver for Gnalloy with UDP, TCP fallback, hosts override, cache, and native macOS configuration provider.
This module provides name-resolution building blocks for higher-level transports and clients. It keeps DNS message parsing, exchange policy, timeout, and cache concerns explicit.
- Import path:
gnalloy.org/resolver-dns - Repository:
github.com/gnalloy/resolver-dns - Default branch:
dev - Preview install:
go get gnalloy.org/resolver-dns@dev - License: Apache-2.0
go get gnalloy.org/resolver-dns@dev
go doc gnalloy.org/resolver-dns
GOWORK=off GOTOOLCHAIN=local go test ./... -count=1- Overview (中文)
- Usage (中文)
- Examples (中文)
- Configuration (中文)
- Testing and Performance (中文)
- API Reference (中文)
- Notes and Caveats (中文)
- ADR-001 Module Boundary (中文)
This repository owns: Go-native DNS resolver for Gnalloy with UDP, TCP fallback, hosts override, cache, and native macOS configuration provider.
It does not absorb neighboring module responsibilities. Core primitives stay in gnalloy.org/gnalloy; protocol codecs, transports, handlers, resolvers, examples, and benchmarks stay in their own repositories.
gnalloy.org/resolver-dns(dns)gnalloy.org/resolver-dns/native/macos(macos)
gnalloy.org/codec-dns
- Configure upstream name servers, exchange timeout, cache policy, search domains, and hosts overrides according to the caller environment.
- Network transport for DNS is explicit: UDP, TCP fallback, or QUIC depending on the resolver module in use.
The generated API reference lists the full public surface. Common constructors or option types currently include:
var ErrNoAnswer = errors.New("gnalloy/resolver/dns: no answer") ...type Config struct{ ... }type ResolverFactory func(Config) *Resolvervar ErrUnsupportedPlatform = errors.New("gnalloy/resolver/dns/native/macos: unsupported platform") ...func NewResolver(ctx context.Context, cfg ResolverConfig) (*resolverdns.Resolver, error)type ResolverConfig struct{ ... }
GOWORK=off GOTOOLCHAIN=local go test ./... -count=1
GOWORK=off GOTOOLCHAIN=local go vet ./...For pressure tests, assemble this module with the relevant transport, codec, and handler stack and run the scenario from gnalloy.org/benchmarks or gnalloy.org/examples. Keep host, operating system, payload, concurrency, warmup, and repetitions in the report.
- This repository is intentionally narrow. Applications assemble cross-module behavior; examples and benchmark harnesses demonstrate and validate it.
- Public APIs should remain Go-native and explicit; avoid runtime scanning, hidden global registries, and reflection-heavy behavior in hot paths.
- Treat network input as untrusted. Configure parser limits and return typed errors instead of panics.
- Keep benchmark claims tied to a concrete host, operating system, protocol, payload, concurrency, warmup, and repetition count.