edgedns

package
v0.0.0-...-4380e07 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

SPDX-License-Identifier: Apache-2.0
Copyright (c) 2019 Intel Corporation

Edge DNS Responder

This project provides a standards compliant DNS server that exposes gRPC interfaces for the realtime creation of records.

Feature Community Edition Enterprise Edition
gRPC Control API
Embedded database
Embedded Forwarder Cache
Nested dynamic Forwarder chains
IPv6 Listeners
IPv6 Record Types
Authoritative TXT Record
Authoritative SRV Record
Dynamic logging levels
Logging to syslog

This Community Edition server implements:

  • DNS Authoritative server
  • Control via gRPC API on a UNIX domain socket

Usage

All queries are processed in the following order:

  1. Authoritative lookup (default TTL of 10 seconds)
  2. Forwarder lookup

The Enterprise Edition allows the dynamic definition of forwarders on a per FQDN basis with hierarchical traversal of forwarders if a given forwarder does not return an answer for the query.

API Client

See the test API client for example usage of the control API.

Logging

By default only major events related to the listeners or databases, as well as control socket API requests, are sent to STDERR.

CLI

You can specify the following options:

flag required default description
4 NO anyhost IPv4 Listen address
port NO 5053 UDP Listen port
sock NO /run/edgedns.sock Filesystem path for the UNIX gRPC socket
db NO /var/lib/edgedns/rrsets.db Filesystem path for persistent database file
fwdr NO 8.8.8.8 IPv4 address of the upstream forwarder

Configuration

The following operations are available via the gRPC inteface on the UNIX domain socket:

  • Set(Create/Update) and Delete operations for an A record

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr4 string
	Port  int
	// contains filtered or unexported fields
}

Config contains all runtime configuration parameters

type ControlServer

type ControlServer interface {
	Start(stg Storage) error
	GracefulStop() error
}

ControlServer provides an API to administer the runtime state of the Responder records

type Responder

type Responder struct {
	Sig chan os.Signal // Shutdown signals
	// contains filtered or unexported fields
}

Responder handles all DNS queries

func NewResponder

func NewResponder(cfg Config, stg Storage, ctl ControlServer) *Responder

NewResponder returns a new DNS Responder (Server)

func (*Responder) SetDefaultForwarder

func (r *Responder) SetDefaultForwarder(fwdr string)

SetDefaultForwarder allows the default forwarder to be changed

func (*Responder) Start

func (r *Responder) Start() error

Start will register and start all services

func (*Responder) Stop

func (r *Responder) Stop()

Stop all listeners

type Storage

type Storage interface {
	Start() error
	Stop() error

	// SetHostRRSet Creates or updates all resource records for a given FQDN
	// 				and resource record type
	//
	// rrtype 		Resource Record Type (A or AAAA)
	// fqdn			Fully Qualified Domain Name
	// addrs		One or more IP addresses for the FQDN
	SetHostRRSet(rrtype uint16, fqdn []byte, addrs [][]byte) error

	// GetRRSet returns all resources records for an FQDN and resource type
	GetRRSet(name string, rrtype uint16) (*[]dns.RR, error)

	// DelRRSet removes a RR set for a given FQDN and resource type
	DelRRSet(rrtype uint16, fqdn []byte) error
}

Storage is a backend persistence for all records

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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