dns

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NameServer

type NameServer struct {
	Net       string
	Addr      string
	Interface string
}

type Resolver

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

func NewResolver

func NewResolver(nameServers []NameServer) *Resolver

func (*Resolver) Exchange

func (r *Resolver) Exchange(m *dns.Msg) (msg *dns.Msg, err error)

Exchange a batch of dns request, and it use cache

func (*Resolver) ExchangeContext

func (r *Resolver) ExchangeContext(ctx context.Context, m *dns.Msg) (msg *dns.Msg, err error)

ExchangeContext a batch of dns request with context.Context, and it use cache

func (*Resolver) LookupIP

func (r *Resolver) LookupIP(ctx context.Context, host string) (ip []net.IP, err error)

LookupIP request with TypeA and TypeAAAA, priority return TypeA

func (*Resolver) LookupIPv4

func (r *Resolver) LookupIPv4(ctx context.Context, host string) ([]net.IP, error)

LookupIPv4 request with TypeA

func (*Resolver) LookupIPv6

func (r *Resolver) LookupIPv6(ctx context.Context, host string) ([]net.IP, error)

LookupIPv6 request with TypeAAAA

func (*Resolver) ResolveIP

func (r *Resolver) ResolveIP(host string) (ip net.IP, err error)

ResolveIP request with TypeA and TypeAAAA, priority return TypeA

func (*Resolver) ResolveIPv4

func (r *Resolver) ResolveIPv4(host string) (ip net.IP, err error)

ResolveIPv4 request with TypeA

func (*Resolver) ResolveIPv6

func (r *Resolver) ResolveIPv6(host string) (ip net.IP, err error)

ResolveIPv6 request with TypeAAAA

Jump to

Keyboard shortcuts

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