Documentation ¶
Overview ¶
Package example is a CoreDNS plugin that prints the DNS query and response to stdout on every packet received and resolves the A record of CNAME targets internally if needed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Example ¶
Example is an example plugin to show how to write a plugin.
func (Example) Ready ¶
Ready implements the ready.Readiness interface, once this flips to true CoreDNS assumes this plugin is ready for queries; it is not checked again.
type ResponsePrinter ¶
type ResponsePrinter struct { dns.ResponseWriter // contains filtered or unexported fields }
ResponsePrinter wraps a dns.ResponseWriter and logs the DNS response message. It also recursively resolves A records for CNAME responses if needed.
func NewResponsePrinter ¶
func NewResponsePrinter(w dns.ResponseWriter, handler plugin.Handler) *ResponsePrinter
NewResponsePrinter returns a ResponsePrinter wrapping the original dns.ResponseWriter and plugin handler.
func (*ResponsePrinter) WriteMsg ¶
func (r *ResponsePrinter) WriteMsg(res *dns.Msg) error
WriteMsg calls the underlying ResponseWriter's WriteMsg method and adds an A record if the response only contains a CNAME.