nsid

package
v0.5.26 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: BSD-3-Clause Imports: 9 Imported by: 0

README

Name

nsid - adds an identifier of this server to each reply

Description

This handler implements RFC 5001 and adds an option code to replies that uniquely identify the server. This is useful in anycast setups to see which server was responsible for generating the reply and for debugging.

Syntax

nsid [DATA]

Where DATA is the string to use in the nsid record. If DATA is not given, the host's name is used.

Examples

Enable nsid:

example.org {
    nsid Use the force
    whoami
}

And now a client with NSID support will see an OPT record with the NSID option:

% dig +nsid @localhost a whoami.example.org

;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46880
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 3

....

; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; NSID: 55 73 65 20 54 68 65 20 46 6f 72 63 65 ("Use The Force")
;; QUESTION SECTION:
;whoami.example.org.		IN	A

See Also

RFC 5001.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Err added in v0.5.2

func Err(err error) slog.Attr

Types

type Nsid

type Nsid struct {
	Data string
}

func (*Nsid) Err

func (h *Nsid) Err(err error) error

func (*Nsid) HandlerFunc

func (n *Nsid) HandlerFunc(next dns.HandlerFunc) dns.HandlerFunc

func (*Nsid) Key

func (h *Nsid) Key() string

func (*Nsid) Setup

func (n *Nsid) Setup(co *dnsserver.Controller) error

Jump to

Keyboard shortcuts

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