dump

package module
v0.0.0-...-def5a1d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

dump

Name

dump - dumps all incoming queries on standard output.

Description

dump uses the synax from the log plugin, and defaults to this format:

{remote} - {>id} {type} {class} {name} {proto} {port}

So a query will show up as:

:1 - 3644 MX IN example.net. udp 46481

Note that this is shorter than the default for log so you can distinguish between the two outputs. log only logs queries that have seen a response, so this plugin can be used as a debugging aid to just dump all incoming queries.

Syntax

dump

Examples

Dump all queries.

. {
    dump
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dump

type Dump struct {
	Next plugin.Handler
}

Dump implement the plugin interface.

func (Dump) Name

func (d Dump) Name() string

Name implements the Handler interface.

func (Dump) Ready

func (d Dump) Ready() bool

func (Dump) ServeDNS

func (d Dump) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

ServeDNS implements the plugin.Handler interface.

type ResponsePrinter

type ResponsePrinter struct {
	dns.ResponseWriter
}

ResponsePrinter wrap a dns.ResponseWriter and will write example to standard output when WriteMsg is called.

func NewResponsePrinter

func NewResponsePrinter(w dns.ResponseWriter) *ResponsePrinter

NewResponsePrinter returns ResponseWriter.

func (*ResponsePrinter) WriteMsg

func (r *ResponsePrinter) WriteMsg(res *dns.Msg) error

WriteMsg calls the underlying ResponseWriter's WriteMsg method and prints "example" to standard output.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL