dns

package
v0.1.26 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultResolver

type DefaultResolver interface {
	LookupTXT(name string) ([]string, error)
	LookupAddress(name string) ([]string, error)
	LookupCNAME(name string) (string, error)
	LookupMX(name string) ([]*MxResp, error)
}

func CustomResolver

func CustomResolver(address, network string) DefaultResolver

CustomResolver creates a new resolver using network given, connecting to the address provided

func NewResolver

func NewResolver() DefaultResolver

NewResolver creates and uses a default resolver

type MxResp

type MxResp struct {
	Host string
	Pref uint16
}

type Resolver

type Resolver uint32

func (Resolver) LookupAddress

func (r Resolver) LookupAddress(ip string) ([]string, error)

LookupAddr performs a reverse lookup for the given address, returning a list of names mapping to that address and an error.

func (Resolver) LookupCNAME

func (r Resolver) LookupCNAME(fqdn string) (string, error)

LookupCNAME returns the canonical name for the given host.

LookupCNAME does not return an error if the given name does not contain DNS "CNAME" records, as long as the name resolves to address records.

func (Resolver) LookupMX

func (r Resolver) LookupMX(fqdn string) ([]*MxResp, error)

LookupMX returns the DNS MX records for the given name and an error.

func (Resolver) LookupTXT

func (r Resolver) LookupTXT(fqdn string) ([]string, error)

LookupTXT returns the DNS TXT records for the given domain name.

Jump to

Keyboard shortcuts

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