config

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Version          string
	Directory        string
	BlockLists       []string
	BlockListDir     string
	RootServers      []string
	Root6Servers     []string
	DNSSEC           string
	RootKeys         []string
	FallbackServers  []string
	ForwarderServers []string
	AccessList       []string
	LogLevel         string
	AccessLog        string
	Bind             string
	BindTLS          string
	BindDOH          string
	BindDOQ          string
	TLSCertificate   string
	TLSPrivateKey    string
	API              string
	BearerToken      string
	Nullroute        string
	Nullroutev6      string
	HostsFile        string
	OutboundIPs      []string
	OutboundIP6s     []string
	Timeout          Duration
	QueryTimeout     Duration
	Expire           uint32
	CacheSize        int
	Prefetch         uint32
	Maxdepth         int
	RateLimit        int
	ClientRateLimit  int
	NSID             string
	Blocklist        []string
	Whitelist        []string
	Chaos            bool
	QnameMinLevel    int `toml:"qname_min_level"`
	EmptyZones       []string

	// Dnstap configuration
	DnstapSocket        string
	DnstapIdentity      string
	DnstapVersion       string
	DnstapLogQueries    bool
	DnstapLogResponses  bool
	DnstapFlushInterval int

	// Domain metrics configuration
	DomainMetrics      bool
	DomainMetricsLimit int

	// Kubernetes middleware configuration as a section
	Kubernetes KubernetesConfig `toml:"kubernetes"`

	Plugins map[string]Plugin

	CookieSecret string
	IPv6Access   bool `toml:"ipv6access"`

	// TCP connection pooling configuration
	TCPKeepalive      bool
	RootTCPTimeout    Duration // Timeout for root server TCP connections
	TLDTCPTimeout     Duration // Timeout for TLD server TCP connections
	TCPMaxConnections int      // Maximum number of TCP connections to pool
	// contains filtered or unexported fields
}

Config type.

func Load

func Load(cfgfile, version string) (*Config, error)

Load loads the given config file.

func (*Config) ServerVersion added in v1.0.0

func (c *Config) ServerVersion() string

(*Config).ServerVersion serverVersion return current server version.

type Duration added in v0.3.0

type Duration struct {
	time.Duration
}

Duration type.

func (*Duration) UnmarshalText added in v0.3.0

func (d *Duration) UnmarshalText(text []byte) error

(*Duration).UnmarshalText unmarshalText for duration type.

type KubernetesConfig added in v1.6.0

type KubernetesConfig struct {
	Enabled       bool                `toml:"enabled"`
	ClusterDomain string              `toml:"cluster_domain"`
	KillerMode    bool                `toml:"killer_mode"`
	Kubeconfig    string              `toml:"kubeconfig"`
	TTL           KubernetesTTLConfig `toml:"ttl"`
}

KubernetesConfig holds Kubernetes middleware configuration

type KubernetesTTLConfig added in v1.6.0

type KubernetesTTLConfig struct {
	Service uint32 `toml:"service"`
	Pod     uint32 `toml:"pod"`
	SRV     uint32 `toml:"srv"`
	PTR     uint32 `toml:"ptr"`
}

KubernetesTTLConfig holds TTL settings for different record types

type Plugin added in v1.1.0

type Plugin struct {
	Path   string
	Config map[string]any
}

Plugin type.

Jump to

Keyboard shortcuts

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