Documentation ¶
Index ¶
- Variables
- func Close() error
- func FindCname(msg *dns.Msg) (string, bool)
- func FindExtras(msg *dns.Msg) []string
- func FindNS(msg *dns.Msg) ([]string, bool)
- func FindNSExtras(msg *dns.Msg) (*dns.Msg, bool)
- func GotAnswer(msg *dns.Msg) bool
- func IsEmptyResponse(msg *dns.Msg) bool
- func IsSuccessfulResponse(msg *dns.Msg) bool
- func NewQuery(names []string) *dns.Msg
- func NewResponse(rcode int) *dns.Msg
- func Start(cfg *Config) error
- type Config
- type Record
- type Trie
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("Not Found") ErrServerFailed = errors.New("Server Failed") ErrInvalidResponse = errors.New("Invalid Response") ErrUnexpectedResp = errors.New("Unexpected Response") ErrHugePacket = errors.New("Huge Packet") ErrCyclicCNAME = errors.New("Maybe cyclic CNAME") )
predefined errors
Functions ¶
func FindExtras ¶
FindExtras gets a string array from msg's extra rr
func FindNSExtras ¶
FindNSExtras gets a copied message from msg, the copy's answer is msg's extra
func GotAnswer ¶
GotAnswer gets whether do get the answer, whose RRtype is same as Qtype or the NS RR is a SOA
func IsEmptyResponse ¶
IsEmptyResponse gets whether the msg is an empty response which has no answer, no ns and no extra
func IsSuccessfulResponse ¶
IsSuccessfulResponse gets whether the msg is a successful response
func NewResponse ¶
NewResponse creates a new dns response message with the gived rcode
Types ¶
type Config ¶
type Config struct { // address to listen on Addr string // up dns servers to proxy UpServers []string // proxy with dns cache WithCache bool CacheFile string // worker pool size WorkerPoolMin, WorkerPoolMax int }
Config is the config about the dnsproxy
type Record ¶
Record is a cached record, Expired is the expire timestamp, Msg is the dns message.
Click to show internal directories.
Click to hide internal directories.