bdns

package
v0.0.0-...-f5e5ed5 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2015 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProblemDetailsFromDNSError

func ProblemDetailsFromDNSError(err error) *probs.ProblemDetails

ProblemDetailsFromDNSError checks the error returned from Lookup... methods and tests if the error was an underlying net.OpError or an error caused by resolver returning SERVFAIL or other invalid Rcodes and returns the relevant core.ProblemDetails.

Types

type DNSResolver

type DNSResolver interface {
	LookupTXT(string) ([]string, error)
	LookupHost(string) ([]net.IP, error)
	LookupCAA(string) ([]*dns.CAA, error)
	LookupMX(string) ([]string, error)
}

DNSResolver defines methods used for DNS resolution

type DNSResolverImpl

type DNSResolverImpl struct {
	DNSClient *dns.Client
	Servers   []string
	// contains filtered or unexported fields
}

DNSResolverImpl represents a client that talks to an external resolver

func NewDNSResolverImpl

func NewDNSResolverImpl(readTimeout time.Duration, servers []string, stats metrics.Scope) *DNSResolverImpl

NewDNSResolverImpl constructs a new DNS resolver object that utilizes the provided list of DNS servers for resolution.

func NewTestDNSResolverImpl

func NewTestDNSResolverImpl(readTimeout time.Duration, servers []string, stats metrics.Scope) *DNSResolverImpl

NewTestDNSResolverImpl constructs a new DNS resolver object that utilizes the provided list of DNS servers for resolution and will allow loopback addresses. This constructor should *only* be called from tests (unit or integration).

func (*DNSResolverImpl) LookupCAA

func (dnsResolver *DNSResolverImpl) LookupCAA(hostname string) ([]*dns.CAA, error)

LookupCAA sends a DNS query to find all CAA records associated with the provided hostname. If the response code from the resolver is SERVFAIL an empty slice of CAA records is returned.

func (*DNSResolverImpl) LookupHost

func (dnsResolver *DNSResolverImpl) LookupHost(hostname string) ([]net.IP, error)

LookupHost sends a DNS query to find all A records associated with the provided hostname. This method assumes that the external resolver will chase CNAME/DNAME aliases and return relevant A records.

func (*DNSResolverImpl) LookupMX

func (dnsResolver *DNSResolverImpl) LookupMX(hostname string) ([]string, error)

LookupMX sends a DNS query to find a MX record associated hostname and returns the record target.

func (*DNSResolverImpl) LookupTXT

func (dnsResolver *DNSResolverImpl) LookupTXT(hostname string) ([]string, error)

LookupTXT sends a DNS query to find all TXT records associated with the provided hostname.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳