Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMessagesToReply ¶ added in v0.5.5
AddMessagesToReply creates information resource records using MakeMessageRecord and immediately adds them to the extra section of the given reply. If an error occurs, the resource record will not be added, and the error will be logged.
Types ¶
type RRProvider ¶
type RRProvider interface { // GetExtraRRs is called when a DNS response to a DNS message is // crafted because the request is either denied or blocked. GetExtraRRs(ctx context.Context, request *dns.Msg) []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(ctx context.Context, request *dns.Msg) *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 Localhost ¶ added in v0.5.5
func Localhost(msgs ...string) ResponderFunc
Localhost is a ResponderFunc than replies with localhost IP addresses.
func NxDomain ¶
func NxDomain(msgs ...string) ResponderFunc
NxDomain returns a ResponderFunc that replies with NXDOMAIN.
func Refused ¶
func Refused(msgs ...string) ResponderFunc
Refused returns a ResponderFunc that replies with REFUSED.
func ServerFailure ¶ added in v0.5.5
func ServerFailure(msgs ...string) ResponderFunc
ServerFailure returns a ResponderFunc that replies with SERVFAIL.
func ZeroIP ¶
func ZeroIP(msgs ...string) 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.