dnsclient

package
v0.0.0-...-4a06a8c Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCAARecordNotFound = fmt.Errorf("No CAA record found")
)
View Source
var (
	ErrCNAMERecordNotFound = fmt.Errorf("No CNAME record found")
)

Functions

This section is empty.

Types

type CAACheckResult

type CAACheckResult struct {
	HasCAA        bool
	HasAccountUri bool
}

type CAARecord

type CAARecord struct {
	Tag               string
	Issuer            string
	ValidationMethods []string
	AccountUri        string
	Data              string
}

func NewRecord

func NewRecord() CAARecord

NewRecord creates a new Record instance

func ParseNewRecord

func ParseNewRecord(caa *dns.CAA) (CAARecord, error)

ParseNewRecord parses a CAA entry, and returns a new Record instance

func (*CAARecord) HasAccountURI

func (c *CAARecord) HasAccountURI() bool

HasAccountURI returns true if AccountURI for the CAA record has been set

func (*CAARecord) IsSet

func (c *CAARecord) IsSet() bool

IsSet returns true if CAA record has been set. This is determined by if Issuer field exists

type CNAMERecord

type CNAMERecord struct {
	Domain   string
	HasCNAME bool
	Target   string
}

func NewCNAMERecord

func NewCNAMERecord() CNAMERecord

func (*CNAMERecord) CorrectTarget

func (r *CNAMERecord) CorrectTarget(acmednsdomain string) bool

CorrectTarget returns true if the CNAME has been set correctly according to acme-dns account.

type Client

type Client struct {
	Server string
}

func NewDNSClient

func NewDNSClient(server string) *Client

func (*Client) CheckCAA

func (c *Client) CheckCAA(domain string) (CAACheckResult, error)

CheckCAA performs checks to CAA records in order to determine if the domain has a CAA record and if the CAA record includes AccountURI parameter.

func (*Client) GetAuthoritativeNS

func (c *Client) GetAuthoritativeNS(domain string) (string, error)

GetAuthoritativeNS returns the first authoritative name server (from NS records) of a domain

func (*Client) GetCAA

func (c *Client) GetCAA(domain string) ([]CAARecord, error)

GetCAA fetches the CAA records for a domain

func (*Client) GetCNAME

func (c *Client) GetCNAME(domain string) (CNAMERecord, error)

GetCNAME fetches the CNAME for ACME "magic" subdomain _acme-challenge for a domain

Jump to

Keyboard shortcuts

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