Documentation ¶
Index ¶
- Variables
- func Init(kubeController k8s.Controller, configurator configurator.Configurator)
- func Start()
- func Stop()
- func UnFqdn(s string) string
- func WatchAndUpdateLocalDNSProxy(msgBroker *messaging.Broker, stop <-chan struct{})
- type Config
- func (c *Config) GenerateIPv6BasedOnIPv4() bool
- func (c *Config) GetInterval() int
- func (c *Config) GetLoopbackResolveDB() []*configv1alpha3.ResolveAddr
- func (c *Config) GetNXDomain() bool
- func (c *Config) GetNameservers() []string
- func (c *Config) GetTimeout() int
- func (c *Config) GetWildcardResolveDB() []*configv1alpha3.ResolveAddr
- func (c *Config) IsWildcard() bool
- type CustomDNSRecords
- type DNSHandler
- func (h *DNSHandler) DoTCP(w dns.ResponseWriter, req *dns.Msg)
- func (h *DNSHandler) DoUDP(w dns.ResponseWriter, req *dns.Msg)
- func (h *DNSHandler) HandleFailed(w dns.ResponseWriter, req *dns.Msg)
- func (h *DNSHandler) HandleWildcard(req *dns.Msg, cfg *Config, ipQuery int, q *dns.Question, w dns.ResponseWriter)
- func (h *DNSHandler) WriteReplyMsg(w dns.ResponseWriter, message *dns.Msg)
- type DNSOperationData
- type Question
- type QuestionCacheEntry
- type ResolvError
- type Resolver
- type Server
Constants ¶
This section is empty.
Variables ¶
var WallClock = clockwork.NewRealClock()
WallClock is the wall clock
Functions ¶
func Init ¶
func Init(kubeController k8s.Controller, configurator configurator.Configurator)
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 (*Config) GetInterval ¶
GetInterval concurrency interval for lookups in miliseconds
func (*Config) GetLoopbackResolveDB ¶
func (c *Config) GetLoopbackResolveDB() []*configv1alpha3.ResolveAddr
func (*Config) GetNXDomain ¶
GetNXDomain response to blocked queries with a NXDOMAIN
func (*Config) GetNameservers ¶
GetNameservers nameservers to forward queries to
func (*Config) GetTimeout ¶
GetTimeout query timeout for dns lookups in seconds
func (*Config) GetWildcardResolveDB ¶
func (c *Config) GetWildcardResolveDB() []*configv1alpha3.ResolveAddr
func (*Config) IsWildcard ¶
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 (*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
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
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.