dns

package
v0.0.0-...-90ffb0e Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package models the distributed DNS database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

Database models the global DNS database.

func NewDatabase

func NewDatabase() *Database

NewDatabase creates a new DNS database.

func (*Database) AddAddresses

func (dd *Database) AddAddresses(domainNames, addresses []string)

AddAddresses adds A/AAAA records mapping the given domainNames to the given IPv4/IPv6 addresses.

This method IS NOT goroutine safe.

func (*Database) AddCNAME

func (dd *Database) AddCNAME(name, alias string)

AddCNAME adds a CNAME alias.

This method IS NOT goroutine safe.

func (*Database) Handle

func (dd *Database) Handle(rw dnscoretest.ResponseWriter, rawQuery []byte)

Handler implements [dnsHandler] using [*dnsDatabase].

This method is goroutine safe as long as one does not modify the database while handling queries.

func (*Database) Lookup

func (dd *Database) Lookup(qtype uint16, name string) ([]dns.RR, bool)

Lookup returns the DNS records for a domain name.

This method is goroutine safe as long as one does not modify the database while handling queries.

type Handler

type Handler = dnscoretest.Handler

Handler is an alias for dnscoretest.Handler.

Jump to

Keyboard shortcuts

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