Documentation
¶
Overview ¶
Package server answers DNS over UDP and TCP: parse, decide, then either answer from the sinkhole or forward the raw query upstream.
The core (respond, forward) does not care about the transport. udp.go and tcp.go only move bytes in and out.
Index ¶
Constants ¶
const IdleTimeout = 10 * time.Second
IdleTimeout closes TCP connections that send nothing for this long. RFC 7766 section 6.2.3 suggests a few seconds for a busy server.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type QueryLog ¶
type QueryLog int
QueryLog chooses which queries get a log line.
func ParseQueryLog ¶
type Server ¶
type Server struct {
Cache *cache.Cache // nil disables caching
Detect *detect.Detector // nil disables threat detection
Events *events.Hub // nil: no live viewers
Stats *stats.Stats // nil: no dashboard statistics
Upstream *upstream.Pool // resolvers with failover, UDP and TCP
Local func(name string) *upstream.Pool // your own zones (-forward); nil or a nil result means Upstream
ACL *guard.ACL // nil: every client may ask
Limit *guard.Limiter // nil: no rate limit
Log *slog.Logger
QueryLog QueryLog
// contains filtered or unexported fields
}
func (*Server) BlocklistSize ¶
BlocklistSize reports how many domains the active policy blocks.