boulder: github.com/letsencrypt/boulder/bdns Index | Files

package bdns

import "github.com/letsencrypt/boulder/bdns"

Index

Package Files

dns.go mocks.go problem.go

func MockTimeoutError Uses

func MockTimeoutError() *net.OpError

MockTimeoutError returns a a net.OpError for which Timeout() returns true.

type DNSClient Uses

type DNSClient interface {
    LookupTXT(context.Context, string) (txts []string, err error)
    LookupHost(context.Context, string) ([]net.IP, error)
    LookupCAA(context.Context, string) ([]*dns.CAA, error)
}

DNSClient queries for DNS records

type DNSClientImpl Uses

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

DNSClientImpl represents a client that talks to an external resolver

func NewDNSClientImpl Uses

func NewDNSClientImpl(
    readTimeout time.Duration,
    servers []string,
    stats metrics.Scope,
    clk clock.Clock,
    maxTries int,
) *DNSClientImpl

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

func NewTestDNSClientImpl Uses

func NewTestDNSClientImpl(readTimeout time.Duration, servers []string, stats metrics.Scope, clk clock.Clock, maxTries int) *DNSClientImpl

NewTestDNSClientImpl 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 (*DNSClientImpl) LookupCAA Uses

func (dnsClient *DNSClientImpl) LookupCAA(ctx context.Context, hostname string) ([]*dns.CAA, error)

LookupCAA sends a DNS query to find all CAA records associated with the provided hostname.

func (*DNSClientImpl) LookupHost Uses

func (dnsClient *DNSClientImpl) LookupHost(ctx context.Context, hostname string) ([]net.IP, error)

LookupHost sends a DNS query to find all A and AAAA records associated with the provided hostname. This method assumes that the external resolver will chase CNAME/DNAME aliases and return relevant records. It will retry requests in the case of temporary network errors. It can return net package, context.Canceled, and context.DeadlineExceeded errors, all wrapped in the DNSError type.

func (*DNSClientImpl) LookupTXT Uses

func (dnsClient *DNSClientImpl) LookupTXT(ctx context.Context, hostname string) ([]string, error)

LookupTXT sends a DNS query to find all TXT records associated with the provided hostname which it returns along with the returned DNS authority section.

type DNSError Uses

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

DNSError wraps a DNS error with various relevant information

func (DNSError) Error Uses

func (d DNSError) Error() string

func (DNSError) Timeout Uses

func (d DNSError) Timeout() bool

Timeout returns true if the underlying error was a timeout

func (DNSError) Underlying Uses

func (d DNSError) Underlying() error

type MockDNSClient Uses

type MockDNSClient struct {
}

MockDNSClient is a mock

func (*MockDNSClient) LookupCAA Uses

func (mock *MockDNSClient) LookupCAA(_ context.Context, domain string) ([]*dns.CAA, error)

LookupCAA returns mock records for use in tests.

func (*MockDNSClient) LookupHost Uses

func (mock *MockDNSClient) LookupHost(_ context.Context, hostname string) ([]net.IP, error)

LookupHost is a mock

func (*MockDNSClient) LookupTXT Uses

func (mock *MockDNSClient) LookupTXT(_ context.Context, hostname string) ([]string, error)

LookupTXT is a mock

Package bdns imports 14 packages (graph) and is imported by 76 packages. Updated 2019-11-12. Refresh now. Tools for package owners.