cookie

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: BSD-3-Clause Imports: 11 Imported by: 0

README

Name

cookie - adds an DNS cookie of this server to each reply

Description

This handler implements the DNS cookie RFC.

Syntax

cookie SECRET

Where SECRET is the secret to use in the server cookie generation record.

Examples

Enable cookies:

example.org {
    cookie Use the force
    whoami
}

Context

The cookie handler adds two keys to the context:

Key Type Example Description
cookie/status bool true The validation status of the cookie.
cookie/msgfunc func Function that adds reply cookie to the reply.

Bugs

cookie does not implement a cache to validate client, is just does enough to make dig happy, this implies that cookie/status is always set to true.

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 Cookie struct {
	Secret string
}

func (*Cookie) Err

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

func (*Cookie) HandlerFunc

func (c *Cookie) HandlerFunc(next dns.HandlerFunc) dns.HandlerFunc

func (*Cookie) Key

func (h *Cookie) Key() string

func (*Cookie) Setup

func (c *Cookie) Setup(co *dnsserver.Controller) error

Jump to

Keyboard shortcuts

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