dnscheck

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0 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.

Documentation

Overview

Package dnscheck implements the DNS monitor type (FA-CHK-40/41).

Index

Constants

View Source
const Type = "dns"

Type is the monitor type key.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	// SystemResolvers overrides /etc/resolv.conf (tests only).
	SystemResolvers []string
}

Checker runs DNS checks.

func (*Checker) Check

func (c *Checker) Check(ctx context.Context, env *checker.Env, raw json.RawMessage) checker.Result

Check implements checker.Checker.

func (*Checker) ConfigSchema

func (*Checker) ConfigSchema() json.RawMessage

ConfigSchema implements checker.Checker.

func (*Checker) Name

func (*Checker) Name() string

Name implements checker.Checker.

func (*Checker) Targets

func (*Checker) Targets(raw json.RawMessage) ([]checker.Target, error)

Targets implements checker.TargetLister. Only a configured resolver is a destination; the queried hostname is only looked up and is not checked (ADR 0030). The address is not validated here: ValidateHost does that, so a non-canonical notation gets its own message.

func (*Checker) Type

func (*Checker) Type() string

Type implements checker.Checker.

func (*Checker) Validate

func (*Checker) Validate(raw json.RawMessage) error

Validate implements checker.Checker.

type Config

type Config struct {
	Hostname   string `json:"hostname"`
	RecordType string `json:"recordType,omitempty"`
	// Resolver is "ip" or "ip:port"; empty uses the node's system resolver.
	Resolver string   `json:"resolver,omitempty"`
	Expected []string `json:"expected,omitempty"`
	// MatchMode "contains" (default): every expected value is present;
	// "equals": the answer set equals the expected set (order-insensitive).
	MatchMode string `json:"matchMode,omitempty"`
	Transport string `json:"transport,omitempty"` // udp (default) | tcp
}

Config is the DNS monitor configuration.

Jump to

Keyboard shortcuts

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