Documentation ¶
Overview ¶
Package resolver contains a censoring DNS resolver. Most queries are answered without censorship, but selected queries could either be discarded or replied to with a bogon or NXDOMAIN answer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CensoringResolver ¶
type CensoringResolver struct {
// contains filtered or unexported fields
}
CensoringResolver is a censoring resolver.
func NewCensoringResolver ¶
func NewCensoringResolver( blocked, hijacked, ignored []string, uncensored netx.Resolver, ) *CensoringResolver
NewCensoringResolver creates a new CensoringResolver instance using the specified list of keywords to censor. blocked is the list of keywords that trigger NXDOMAIN if they appear in a query. hijacked is similar but redirects to 127.0.0.1, where the transparent HTTP and TLS proxies will pick them up. dnsNetwork and dnsAddress are the settings to configure the upstream, non censored DNS.
func (*CensoringResolver) ServeDNS ¶
func (r *CensoringResolver) ServeDNS(rw dns.ResponseWriter, req *dns.Msg)
ServeDNS serves a DNS request