Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 1.26 KB

README.md

File metadata and controls

45 lines (33 loc) · 1.26 KB

ConnByte for libdns

Go Reference

This package implements the libdns interfaces for ConnByte, allowing you to manage DNS records with the ConnByte DNS API.

Authenticating

Create an API token in your ConnByte account. The token needs access to the DNS zones you want to manage.

Example

package main

import (
	"context"
	"fmt"
	"os"
	"time"

	"github.com/libdns/connbyte"
	"github.com/libdns/libdns"
)

func main() {
	provider := &connbyte.Provider{APIToken: os.Getenv("CONNBYTE_TOKEN")}

	recs, err := provider.AppendRecords(context.Background(), "example.com.", []libdns.Record{
		libdns.TXT{Name: "_acme-challenge", Text: "token", TTL: 2 * time.Minute},
	})
	if err != nil {
		panic(err)
	}
	fmt.Println(recs)
}

Notes

  • Supported record types: A, AAAA, CNAME, MX, NS, SRV, TXT.
  • TTLs are clamped to the API range of 60 to 86400 seconds. A TTL of 0 means 3600 seconds.
  • The API has no batch operations. SetRecords and DeleteRecords are not atomic.
  • ListZones is supported.