dns

package
v4.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: BSD-3-Clause, GPL-2.0 Imports: 15 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseUint

func ParseUint(s string) (n uint64)

func RegisterService

func RegisterService(dnsaddrs []string, baseurl string) (err error)

func TranslateRRs

func TranslateRRs(jrs *[]DNSRR, rrs *[]dns.RR)

Types

type DNSMsg

type DNSMsg struct {
	Status             int32         `json:"Status,omitempty"`
	TC                 bool          `json:"TC,omitempty"`
	RD                 bool          `json:"RD,omitempty"`
	RA                 bool          `json:"RA,omitempty"`
	AD                 bool          `json:"AD,omitempty"`
	CD                 bool          `json:"CD,omitempty"`
	Question           []DNSQuestion `json:"Question,omitempty"`
	Answer             []DNSRR       `json:"Answer,omitempty"`
	Authority          []DNSRR       `json:"Authority,omitempty"`
	Additional         []DNSRR       `json:"Additional,omitempty"`
	Edns_client_subnet string        `json:"edns_client_subnet,omitempty"`
	Comment            string        `json:"Comment,omitempty"`
}

func (*DNSMsg) TranslateAnswer

func (msg *DNSMsg) TranslateAnswer(quiz *dns.Msg) (resp *dns.Msg, err error)

type DNSQuestion

type DNSQuestion struct {
	Name string `json:"name,omitempty"`
	Type int32  `json:"type,omitempty"`
}

type DNSRR

type DNSRR struct {
	Name string `json:"name,omitempty"`
	Type int32  `json:"type,omitempty"`
	TTL  int32  `json:"TTL,omitempty"`
	Data string `json:"data,omitempty"`
}

func (*DNSRR) Translate

func (jr *DNSRR) Translate() (rr dns.RR)

type HttpsDns

type HttpsDns struct {
	common.Resolver
	// contains filtered or unexported fields
}

func NewHttpsDns

func NewHttpsDns(baseurl string, dialer common.Dialer) (httpsdns *HttpsDns)

func (*HttpsDns) Exchange

func (handler *HttpsDns) Exchange(quiz *dns.Msg) (resp *dns.Msg, err error)

func (*HttpsDns) ExchangeContext

func (handler *HttpsDns) ExchangeContext(ctx context.Context, quiz *dns.Msg) (resp *dns.Msg, d time.Duration, err error)

func (*HttpsDns) QueryHttpsDNS

func (handler *HttpsDns) QueryHttpsDNS(ctx context.Context, qtype, name, subnet string) (jsonresp *DNSMsg, err error)

type TcpClient

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

func NewTcpClient

func NewTcpClient(dialer common.Dialer, network, address string) (client *TcpClient)

func (*TcpClient) Exchange

func (client *TcpClient) Exchange(quiz *dns.Msg) (resp *dns.Msg, err error)

func (*TcpClient) ExchangeContext

func (client *TcpClient) ExchangeContext(ctx context.Context, quiz *dns.Msg) (resp *dns.Msg, d time.Duration, err error)

type TcpServer

type TcpServer struct {
	common.Exchanger
}

func (*TcpServer) ServeConn

func (server *TcpServer) ServeConn(conn net.Conn) (err error)

func (*TcpServer) ServeTun

func (server *TcpServer) ServeTun(conn *tunnel.Conn) (err error)

Jump to

Keyboard shortcuts

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