Documentation
¶
Index ¶
- type ACLConfig
- type ACLZoneConfig
- type BlocklistConfig
- type BlocklistEntry
- type CacheConfig
- type ClusterActionConfig
- type ClusterConfig
- type ClusterPeerConfig
- type ClusterSyncConfig
- type Config
- type DaemonConfig
- type ForwardZoneConfig
- type LocalZoneConfig
- type LoggingConfig
- type RRLConfig
- type RateLimitConfig
- type ResolverConfig
- type SecurityConfig
- type ServerConfig
- type StubZoneConfig
- type WebAuthConfig
- type WebConfig
- type WebDashboardConfig
- type ZabbixConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACLConfig ¶
type ACLConfig struct {
Allow []string
Deny []string
Zones []ACLZoneConfig
}
ACLConfig holds access control list settings.
type ACLZoneConfig ¶
ACLZoneConfig holds per-zone ACL settings.
type BlocklistConfig ¶
type BlocklistConfig struct {
Enabled bool
Lists []BlocklistEntry
RefreshInterval time.Duration
BlockingMode string
CustomIP string
Whitelist []string
}
BlocklistConfig holds blocklist filtering settings.
type BlocklistEntry ¶
BlocklistEntry holds a single blocklist source URL and its format.
type CacheConfig ¶
type CacheConfig struct {
MaxEntries int
MinTTL uint32
MaxTTL uint32
NegMaxTTL uint32
SweepInterval time.Duration
ServeStale bool
StaleTTL uint32
// StaleMaxAge bounds how far past expiry a stale entry may be served
// (RFC 8767 §3.3: "It is RECOMMENDED that responses no longer than
// 1-3 days old be considered for stale serve"). An entry whose live
// expiry is older than this threshold is rejected even when the
// physical record is still in cache. Default is 86400 seconds (1 day).
// Setting 0 keeps the prior unbounded behaviour for operators who
// prefer it, but the strong recommendation is to keep a finite cap so
// long-tail zones cannot pin obsolete data indefinitely.
StaleMaxAge uint32
NoCacheClients []string
Prefetch bool
}
CacheConfig holds cache settings.
type ClusterActionConfig ¶
ClusterActionConfig controls cluster fanout behavior for admin actions.
type ClusterConfig ¶
type ClusterConfig struct {
Enabled bool
Role string
NodeID string
Peers []ClusterPeerConfig
Actions ClusterActionConfig
Sync ClusterSyncConfig
}
ClusterConfig holds optional multi-node cluster settings.
type ClusterPeerConfig ¶
type ClusterPeerConfig struct {
Name string
Enabled bool
APIBase string
APIToken string
SyncFields []string
}
ClusterPeerConfig defines a peer node accessible via admin API.
type ClusterSyncConfig ¶
ClusterSyncConfig controls configuration synchronization behavior.
type Config ¶
type Config struct {
Server ServerConfig
Resolver ResolverConfig
Cache CacheConfig
Security SecurityConfig
Logging LoggingConfig
ACL ACLConfig
Web WebConfig
Daemon DaemonConfig
Zabbix ZabbixConfig
Blocklist BlocklistConfig
Cluster ClusterConfig
LocalZones []LocalZoneConfig
ForwardZones []ForwardZoneConfig
StubZones []StubZoneConfig
}
Config holds the complete application configuration.
type DaemonConfig ¶
DaemonConfig holds daemon mode settings.
type ForwardZoneConfig ¶
ForwardZoneConfig holds a single forward zone: queries matching the zone name are forwarded (RD=1) to the configured upstream addresses.
type LocalZoneConfig ¶
LocalZoneConfig holds a local zone's definition from the config file.
type LoggingConfig ¶
type LoggingConfig struct {
Level string
Format string
FallbackLog string
// FallbackDebug enables JSONL writes to FallbackLog for each
// public-resolver fallback engagement (reason + recovered).
FallbackDebug bool
}
LoggingConfig holds logging settings.
type RRLConfig ¶
type RRLConfig struct {
Enabled bool
ResponsesPerSecond float64
SlipRatio int
IPv4Prefix int
IPv6Prefix int
}
RRLConfig holds response rate limiting settings.
type RateLimitConfig ¶
RateLimitConfig holds rate limiter settings.
type ResolverConfig ¶
type ResolverConfig struct {
MaxDepth int
MaxCNAMEDepth int
UpstreamTimeout time.Duration
UpstreamRetries int
// MaxQueriesPerRequest caps the total number of outbound queries the
// resolver issues while resolving a single client request — across every
// CNAME hop, QNAME-minimisation step, and nameserver-address sub-
// resolution. It is the global backstop against NXNS-style delegation
// amplification (the CVE-2020-8616 family) and runaway referral trees,
// which MaxDepth (a per-iteration *depth* limit) does not bound. 0 or
// negative is floored to the default by clampConfigBounds.
MaxQueriesPerRequest int
// RequestTimeout is the wall-clock deadline for resolving a single client
// request. It bounds pathological delegation/CNAME trees that stay under
// the query budget but where each hop is slow. 0 or negative is floored
// to the default by clampConfigBounds.
RequestTimeout time.Duration
QMinEnabled bool
Caps0x20Enabled bool
PreferIPv4 bool
DNSSECEnabled bool
DNSSECAllowSHA1 bool
// DNSSECNegativeTrustAnchors is the operator-installed NTA list
// (RFC 7646). Each entry is "<zone>|<RFC3339 expiry>|<reason>" — the
// pipe separator keeps the format trivially parseable from a YAML
// list of strings without inventing a nested schema. Empty list
// disables NTA enforcement.
DNSSECNegativeTrustAnchors []string
HardenBelowNXDomain bool
RootHintsRefresh time.Duration
ECSEnabled bool
ECSMaxPrefix int // IPv4 source-prefix ceiling (RFC 7871 §11.1 recommends /24)
ECSMaxPrefixV6 int // IPv6 source-prefix ceiling (RFC 7871 §11.1 recommends /56)
DNS64Enabled bool
DNS64Prefix string
FallbackResolvers []string
UpstreamUDPBufferSize int
// MaxNSNamesPerDelegation caps how many NS hostnames the resolver will
// accept from a single delegation response. A legitimate delegation
// carries 2–13 NS names (RFC 1034 recommends at least 2); an attacker
// can publish dozens or hundreds to amplify resolution work (NXNS
// class, CVE-2020-8616). Default 13 matches BIND's effective cap;
// 0 or negative means unlimited.
MaxNSNamesPerDelegation int
}
ResolverConfig holds resolver settings.
type SecurityConfig ¶
type SecurityConfig struct {
RateLimit RateLimitConfig
RRL RRLConfig
PrivateAddressFilter bool
DNSCookies bool
// DNSCookiesEnforce — RFC 7873 §5.4 strict mode. When true, a UDP
// query without a client cookie is rejected with BADCOOKIE. Default
// false; opt-in for hostile-network deployments. Has no effect
// unless DNSCookies is also true.
DNSCookiesEnforce bool
}
SecurityConfig holds security settings.
type ServerConfig ¶
type ServerConfig struct {
ListenAddr string
MetricsAddr string
MaxUDPSize int
TCPTimeout time.Duration
MaxTCPConns int
MaxUDPWorkers int
GracefulPeriod time.Duration
TCPPipelineMax int
TCPIdleTimeout time.Duration
DoTEnabled bool
DoTListenAddr string
DoQEnabled bool
DoQListenAddr string
TLSCertFile string
TLSKeyFile string
// MaxTCPConnsPerClient caps concurrent TCP connections from a single
// source IP. Default 16 prevents slow-loris style single-source
// exhaustion of the global MaxTCPConns pool while leaving headroom
// for legitimate pipelining (RFC 7766). 0 or negative means unlimited
// (same as the global cap).
MaxTCPConnsPerClient int
// MaxDoTConnsPerClient is the per-source-IP cap for DoT connections.
// Same default and semantics as MaxTCPConnsPerClient.
MaxDoTConnsPerClient int
}
ServerConfig holds server-related settings.
type StubZoneConfig ¶
StubZoneConfig holds a single stub zone: the resolver starts iterative resolution (RD=0) from the configured nameserver addresses instead of roots.
type WebAuthConfig ¶
WebAuthConfig holds web dashboard authentication settings.
type WebConfig ¶
type WebConfig struct {
Enabled bool
Addr string
QueryLogBuffer int
TopClientsLimit int
TopDomainsLimit int
AlertErrorThreshold float64
AlertLatencyMs int
AutoUpdate bool
UpdateCheckInterval time.Duration
Dashboard WebDashboardConfig
Auth WebAuthConfig
DoHEnabled bool
DoH3Enabled bool
TLSEnabled bool
TLSCertFile string
TLSKeyFile string
AutoTLS bool
AutoTLSDomain string
AutoTLSEmail string
AutoTLSCacheDir string
AutoTLSStaging bool
}
WebConfig holds web dashboard settings.
type WebDashboardConfig ¶
WebDashboardConfig holds persisted dashboard layout preferences.
type ZabbixConfig ¶
ZabbixConfig holds Zabbix integration settings.