dns

package
v1.4.14 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WallClock = clockwork.NewRealClock()

WallClock is the wall clock

Functions

func Init

func Init(kubeController k8s.Controller, configurator configurator.Configurator)

func Start

func Start()

func Stop

func Stop()

func UnFqdn

func UnFqdn(s string) string

UnFqdn function

func WatchAndUpdateLocalDNSProxy

func WatchAndUpdateLocalDNSProxy(msgBroker *messaging.Broker, stop <-chan struct{})

Types

type Config

type Config struct {
	CustomDNSRecords []string // manual custom dns entries
	// contains filtered or unexported fields
}

Config holds the configuration parameters

func (*Config) GenerateIPv6BasedOnIPv4

func (c *Config) GenerateIPv6BasedOnIPv4() bool

func (*Config) GetInterval

func (c *Config) GetInterval() int

GetInterval concurrency interval for lookups in miliseconds

func (*Config) GetLoopbackResolveDB

func (c *Config) GetLoopbackResolveDB() []*configv1alpha3.ResolveAddr

func (*Config) GetNXDomain

func (c *Config) GetNXDomain() bool

GetNXDomain response to blocked queries with a NXDOMAIN

func (*Config) GetNameservers

func (c *Config) GetNameservers() []string

GetNameservers nameservers to forward queries to

func (*Config) GetTimeout

func (c *Config) GetTimeout() int

GetTimeout query timeout for dns lookups in seconds

func (*Config) GetWildcardResolveDB

func (c *Config) GetWildcardResolveDB() []*configv1alpha3.ResolveAddr

func (*Config) IsWildcard

func (c *Config) IsWildcard() bool

type CustomDNSRecords

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

func NewCustomDNSRecords

func NewCustomDNSRecords(from map[string][]dns.RR) []CustomDNSRecords

func NewCustomDNSRecordsFromText

func NewCustomDNSRecordsFromText(recordsText []string) []CustomDNSRecords

type DNSHandler

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

DNSHandler type

func NewHandler

func NewHandler(config *Config) *DNSHandler

NewHandler returns a new DNSHandler

func (*DNSHandler) DoTCP

func (h *DNSHandler) DoTCP(w dns.ResponseWriter, req *dns.Msg)

DoTCP begins a tcp query

func (*DNSHandler) DoUDP

func (h *DNSHandler) DoUDP(w dns.ResponseWriter, req *dns.Msg)

DoUDP begins a udp query

func (*DNSHandler) HandleFailed

func (h *DNSHandler) HandleFailed(w dns.ResponseWriter, req *dns.Msg)

HandleFailed handles dns failures

func (*DNSHandler) HandleWildcard

func (h *DNSHandler) HandleWildcard(req *dns.Msg, cfg *Config, ipQuery int, q *dns.Question, w dns.ResponseWriter)

func (*DNSHandler) WriteReplyMsg

func (h *DNSHandler) WriteReplyMsg(w dns.ResponseWriter, message *dns.Msg)

WriteReplyMsg writes the dns reply

type DNSOperationData

type DNSOperationData struct {
	Net string
	// contains filtered or unexported fields
}

DNSOperationData type

type Question

type Question struct {
	Qname  string `json:"name"`
	Qtype  string `json:"type"`
	Qclass string `json:"class"`
}

Question type

func (*Question) String

func (q *Question) String() string

String formats a question

type QuestionCacheEntry

type QuestionCacheEntry struct {
	Date    int64    `json:"date"`
	Remote  string   `json:"client"`
	Blocked bool     `json:"blocked"`
	Query   Question `json:"query"`
}

QuestionCacheEntry represents a full query from a client with metadata

type ResolvError

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

ResolvError type

func (ResolvError) Error

func (e ResolvError) Error() string

Error formats a ResolvError

type Resolver

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

Resolver type

func (*Resolver) Lookup

func (r *Resolver) Lookup(net string, req *dns.Msg, timeout int, interval int, nameServers []string) (*dns.Msg, error)

Lookup will ask each nameserver in top-to-bottom fashion, starting a new request in every second, and return as early as possbile (have an answer). It returns an error if no request has succeeded.

func (*Resolver) Timeout

func (r *Resolver) Timeout(timeout int) time.Duration

Timeout returns the resolver timeout

type Server

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

Server type

Jump to

Keyboard shortcuts

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