core

package
v0.0.0-...-3998255 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(fallbackDNS ...string) dns.Repository

New returns a new DNSCore as a dns.Repository

Types

type DNSCore

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

DNSCore adds a basic Answer / Fallback interaction for miekg's DNS implementation (used on the transport layer)

It holds a list of strings which will be the fallback domain-name servers to contact if a domain's IP is requested but there no records for it

func (*DNSCore) Answer

func (d *DNSCore) Answer(r *store.Record, m *dns.Msg)

Answer will take the IP address populated in the store.Response `r`, and append it as a DNS response to the dns.Msg `m`'s Answer slice

func (*DNSCore) Fallback

func (d *DNSCore) Fallback(r *store.Record, m *dns.Msg)

Fallback will spawn a DNS client and issues a request to the fallback servers with the same query for which there isn't a record in the store.

If there is an answer, it is written to the dns.Msg `r`'s Answer slice; otherwise the request is discarted until it times out

Jump to

Keyboard shortcuts

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