dnsupdate

package module
v0.0.0-...-04be146 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 6 Imported by: 3

README

DNS UPDATE for libdns

Go Reference

This package implements the libdns interfaces for the DNS UPDATE and DNS AXFR protocols, allowing you to manage DNS records.

DNS AXFR is used to list DNS records. DNS UPDATE is used to append, set and delete records.

Usage

The DNS server needs to accept DNS transfer and update requests from the host where libdns is used.

Example Knot configuration

This example configuration allows libdns usage from localhost.

acl:
  - id: local
    address: [127.0.0.1, ::1]
    action: [transfer, update]
zone:
  - domain: example.com
    acl: [local]
Example bind configuration

This example configuration allows libdns usage from localhost.

allow-transfer { 127.0.0.1; };
allow-update { 127.0.0.1; };

Caveats

DNS doesn't have a concept of unique identifier for each record. The DNS UPDATE protocol doesn't support duplicate records (two records with the exact same header and value).

Documentation

Overview

Package dnsupdate implements a DNS record management client compatible with the libdns interfaces for the DNS UPDATE protocol defined in RFC 2136.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	// DNS server address
	Addr string `json:"addr,omitempty"`
	// Transaction signature, with format "algo:name:secret"
	TSIG string `json:"tsig,omitempty"`
}

Provider facilitates DNS record manipulation with the DNS UPDATE protocol.

func (*Provider) AppendRecords

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

AppendRecords adds records to the zone. It returns the records that were added.

func (*Provider) DeleteRecords

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

DeleteRecords deletes the records from the zone. It 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. It returns the updated records.

Jump to

Keyboard shortcuts

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