Documentation
¶
Index ¶
- func ProblemDetailsFromDNSError(err error) *probs.ProblemDetails
- type DNSResolver
- type DNSResolverImpl
- func (dnsResolver *DNSResolverImpl) LookupCAA(hostname string) ([]*dns.CAA, error)
- func (dnsResolver *DNSResolverImpl) LookupHost(hostname string) ([]net.IP, error)
- func (dnsResolver *DNSResolverImpl) LookupMX(hostname string) ([]string, error)
- func (dnsResolver *DNSResolverImpl) LookupTXT(hostname string) ([]string, error)
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.