Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RRProvider ¶
type RRProvider interface { // GetExtraRR is called when a DNS response to a DNS message is // crafted because the request is either denied or blocked. GetExtraRR(query *dns.Msg, reason string, reasonCtx interface{}) []dns.RR }
RRProvider defines the interface that any block/deny reason interface may implement to support adding additional DNS resource records to the DNS responses extra (additional) section.
type Responder ¶
type Responder interface { // ReplyWithDNS is called when a DNS response to a DNS message is // crafted because the request is either denied or blocked. ReplyWithDNS(query *dns.Msg, reason string, reasonCtx interface{}) *dns.Msg }
Responder defines the interface that any block/deny reason interface may implement to support sending custom DNS responses for a given reason. That is, if a reason context implements the Responder interface the ReplyWithDNS method will be called instead of creating the default zero-ip response.
type ResponderFunc ¶
ResponderFunc is a convenience type to use a function directly as a Responder.
func NxDomain ¶
func NxDomain() ResponderFunc
NxDomain returns a ResponderFunc that replies with NXDOMAIN.
func Refused ¶
func Refused() ResponderFunc
Refused returns a ResponderFunc that replies with REFUSED.
func ServeFail ¶
func ServeFail() ResponderFunc
ServeFail returns a ResponderFunc that replies with SERVFAIL.
func ZeroIP ¶
func ZeroIP() ResponderFunc
ZeroIP is a ResponderFunc than replies with either 0.0.0.0 or :: for each A or AAAA question respectively.
func (ResponderFunc) ReplyWithDNS ¶
ReplyWithDNS implements the Responder interface and calls rf.