Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HostResolver ¶ added in v1.6.0
type Proxy ¶
type Proxy struct { // Addrs specifies the TCP/UDP address to listen to, :53 if empty. Addrs []string // LocalResolver is called before the upstream to resolve local hostnames or // IPs. LocalResolver HostResolver // Upstream specifies the resolver used for incoming queries. Upstream resolver.Resolver // DiscoveryResolver is called after the upstream if no result was found. DiscoveryResolver HostResolver // BogusPriv specifies that reverse lookup on private subnets are answerd // with NXDOMAIN. BogusPriv bool // Timeout defines the maximum allowed time allowed for a request before // being cancelled. Timeout time.Duration // Maximum number of inflight requests. Further requests will // not be answered. MaxInflightRequests uint // QueryLog specifies an optional log function called for each received query. QueryLog func(QueryInfo) // InfoLog specifies an option log function called when some actions are // performed. InfoLog func(string) // ErrorLog specifies an optional log function for errors. If not set, // errors are not reported. ErrorLog func(error) }
Proxy is a DNS53 to DNS over anything proxy.
func (Proxy) ListenAndServe ¶
ListenAndServe listens on UDP and TCP and serve DNS queries. If ctx is canceled, listeners are closed and ListenAndServe returns context.Canceled error.
Click to show internal directories.
Click to hide internal directories.