type BasicServer struct { // Zones is a list of DNS zones that this server should accept responses // for. Zones []string // Handler is an optional Handler dns.Handler // TSIG configuration options // EnableTSIG enables TSIG support for the DNS server // If true, both TSIGKeyName and TSIGKeySecret must be provided. EnableTSIG bool // TSIGKeyName to be used in responses when TSIG is enabled TSIGKeyName string // TSIGKeySecret to be used in responses when TSIG is enabled TSIGKeySecret string // TSIGZone is the DNS zone that should be used in TSIG responses TSIGZone string // contains filtered or unexported fields }
func (b *BasicServer) ListenAddr() string
func (b *BasicServer) Run(ctx context.Context) error
Run starts the test DNS server, binding to a random port on 127.0.0.1
func (b *BasicServer) RunWithAddress(ctx context.Context, listenAddr string) error
RunWithAddress starts the test DNS server using the specified listen address.
func (b *BasicServer) Shutdown() error