servfail

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

servfail

A coredns plugin that returns a SERVFAIL with the Authoritative and RecursionAvailable flags set.

Usage:

Add the following to plugins.cfg, before debug:

servfail:github.com/nicelocal/servfail

And use the following example Corefile:

. {
    servfail
}

Example dockerfile:

FROM golang

RUN git clone -b v1.12.0 --depth 1 https://github.com/coredns/coredns /coredns && \
    cd /coredns && \
    sed '/bind:bind/a servfail:github.com/nicelocal/servfail' plugin.cfg -i && \
    make

FROM scratch

COPY --from=0 /coredns/coredns /coredns

ENTRYPOINT ["/coredns"]

Documentation

Overview

Package example is a CoreDNS plugin that prints "example" to stdout on every packet received.

It serves as an example CoreDNS plugin with numerous code comments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServFail

type ServFail struct {
	Next plugin.Handler
}

func (*ServFail) Name

func (e *ServFail) Name() string

Name implements the Handler interface.

func (ServFail) Ready

func (e ServFail) Ready() bool

Ready implements the ready.Readiness interface, once this flips to true CoreDNS assumes this plugin is ready for queries; it is not checked again.

func (*ServFail) ServeDNS

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

ServeDNS implements the plugin.Handler interface. This method gets called when example is used in a Server.

Jump to

Keyboard shortcuts

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