dns

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: Apache-2.0 Imports: 18 Imported by: ? 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

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNXDomain      = errors.New("non existent domain")
	ErrNoQTypeRecord = errors.New("domain exists but no record matching the question type")
)

Functions

func Configure added in v1.5.0

func Configure() error

func Init added in v1.5.0

func Init() error

func SyncDNS

func SyncDNS(network string, dnsEntries []models.DNSEntry) error

Sync up the DNS entries with NM server

Types

type DNSResolver

type DNSResolver struct {
	DnsEntriesCacheStore map[string]dns.RR
	DnsEntriesCacheMap   map[string][]dnsRecord
}
var DnsResolver *DNSResolver

func GetDNSResolverInstance

func GetDNSResolverInstance() *DNSResolver

GetInstance

func (*DNSResolver) Lookup

func (d *DNSResolver) Lookup(m *dns.Msg) (dns.RR, error)

Lookup DNS entry in local directory

func (*DNSResolver) RegisterA

func (d *DNSResolver) RegisterA(record dnsRecord) error

Register A record

func (*DNSResolver) RegisterAAAA

func (d *DNSResolver) RegisterAAAA(record dnsRecord) error

Register AAAA record

type DNSServer

type DNSServer struct {
	DnsServer []*dns.Server
	AddrList  []string
	AddrStr   string
}

func GetDNSServerInstance

func GetDNSServerInstance() *DNSServer

GetInstance

func (*DNSServer) Start

func (dnsServer *DNSServer) Start()

Start the DNS listener

func (*DNSServer) Stop

func (dnsServer *DNSServer) Stop()

Stop the DNS listener

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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