duckdns

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2025 License: MIT Imports: 12 Imported by: 14

README

Duck DNS for libdns

godoc reference

This package implements the libdns interfaces for Duck DNS.

Authenticating

This package uses API Token authentication. Refer to the Duck DNS documentation for more information.

Start by retrieving your API token from the table at the top of the account page to be able to make authenticated requests to the API.

NOTE: Duck DNS only supports A/AAAA and TXT records, so it cannot be used for Encrypted ClientHello (ECH), which uses HTTPS records.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	// The DuckDNS API token.
	APIToken string `json:"api_token,omitempty"`

	// An override to the domain, useful if the domain being
	// managed does not belong to DuckDNS, and instead is
	// pointing to DuckDNS using a CNAME record. This allows
	// using DuckDNS' API to manage records for other domains
	// which have worse or no programmable APIs.
	OverrideDomain string `json:"override_domain,omitempty"`

	// An optional resolver to use when doing DNS queries to
	// load the current records. By default, 8.8.8.8:53 is used,
	// i.e. Google's public DNS server.
	Resolver string `json:"resolver,omitempty"`
	// contains filtered or unexported fields
}

Provider implements the libdns interfaces for Duck DNS.

func (*Provider) AppendRecords

func (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

AppendRecords adds records to the zone and returns the records that were created.

func (*Provider) DeleteRecords

func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

DeleteRecords deletes records from the zone and returns the records that were deleted.

func (*Provider) GetRecords

func (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error)

GetRecords lists all the records in the zone.

func (*Provider) SetRecords

func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

SetRecords sets the records in the zone, either by updating existing records or creating new ones, and returns the recordsthat were updated.

Jump to

Keyboard shortcuts

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