Help us shape the future of Go! Take the 2026 Go Developer Survey

nsd

package
v0.0.0-...-a5dbc9d Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package nsd configures and runs an NSD nameserver that implements gitlab.com/internetstiftelsen-oss/dnse/nameserver.Nameserver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsHexString

func IsHexString(s string) bool

IsHexString tests wether or not a string consists of only hexadecimal digits or not.

Types

type AddrPort

type AddrPort struct {
	netip.AddrPort
}

AddrPort wraps netip.AddrPort to fit NSD syntax.

func (*AddrPort) String

func (a *AddrPort) String() string

type Allow

type Allow struct {
	netip.Prefix
	Key string
}

Allow is a pattern for name servers allowed to do something, e.g. XFR.

func (*Allow) String

func (a *Allow) String() string

type Bool

type Bool bool

Bool wraps bool to stringify to NSD syntax; ‘no’ or ‘yes’.

func (Bool) String

func (b Bool) String() string

type Config

type Config struct {
	RemoteControl *RemoteControl
	Server        *Server
	TSIGKeys      []*tsig.Key
	Verify        *Verify
	Zones         dnse.NameMap[Zone]
}

Config contains an entire NSD configuration.

The format of NSD’s configuration is, as with most things NSD, not fully documented. The documentation covers some of it, the sample file gives some more clues.

func (*Config) Write

func (c *Config) Write(_ context.Context, w io.Writer) error

type NSD

type NSD struct {
	// contains filtered or unexported fields
}

NSD is an instance of an NSD name server.

func New

func New(ctx context.Context) (*NSD, error)

New returns a new NSD.

func (*NSD) CheckHealth

func (n *NSD) CheckHealth(ctx context.Context) []health.Check

CheckHealth implements github.com/dotse/go-health.Checker.

func (*NSD) Close

func (n *NSD) Close() (err error)

Close cleans up after the NSD name server.

func (*NSD) Configure

func (n *NSD) Configure(
	ctx context.Context,
	config *nameserver.Config,
) (err error)

Configure configures the NSD name server.

func (*NSD) ReloadZone

func (n *NSD) ReloadZone(
	ctx context.Context,
	zone dnse.Name,
) error

ReloadZone reloads a zone.

func (*NSD) Run

func (n *NSD) Run(ctx context.Context, notifyStarted func()) error

Run runs the NSD name server until the context is cancelled.

type QuotedString

type QuotedString string

QuotedString wraps a string to stringify to a quoted string.

func (QuotedString) String

func (q QuotedString) String() string

type Remote

type Remote struct {
	AddrPort
	Key string
}

Remote is a remote name server with an address, a port and an optional TSIG key (name).

func (*Remote) String

func (r *Remote) String() string

type RemoteControl

type RemoteControl struct {
	ControlCertFile QuotedString
	ControlKeyFile  QuotedString
	Interface       QuotedString
	ServerCertFile  QuotedString
	ServerKeyFile   QuotedString
}

RemoteControl configures NSD’s IPC.

type Server

type Server struct {
	Count          uint64
	Database       QuotedString
	Debug          Bool
	DoIP6          Bool
	IPAddress      []AddrPort
	Identity       QuotedString
	NSID           QuotedString
	PIDFile        QuotedString
	Verbosity      int
	XFRDFile       QuotedString
	XFRDir         QuotedString
	ZoneListFile   QuotedString
	ZonefilesWrite nameserver.Duration
	ZonesDir       QuotedString
}

Server holds NSD’s server configuration.

type Verify

type Verify struct {
	Count       uint64
	FeedZone    Bool
	IPAddress   []AddrPort
	Port        uint16
	Timeout     nameserver.Duration
	Verifier    string
	VerifyZones Bool
}

Verify holds NSD’s verify configuration.

type Zone

type Zone struct {
	AllowNotify    []Allow
	AllowQuery     []Allow
	CreateIXFR     Bool
	IXFRNumber     uint64
	IXFRSize       uint64
	MaxRefreshTime nameserver.Duration
	MaxRetryTime   nameserver.Duration
	MinExpireTime  nameserver.Duration
	MinRefreshTime nameserver.Duration
	MinRetryTime   nameserver.Duration
	Notify         []Remote
	NotifyRetry    uint64
	ProvideXFR     []Allow
	RequestXFR     []Remote
	StoreIXFR      Bool
	Zonefile       QuotedString
}

Zone holds NSD’s zone configuration.

Jump to

Keyboard shortcuts

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