Skip to content

libdns/autodns

Folders and files

NameName
Last commit message
Last commit date
Nov 18, 2024
Nov 18, 2024
Nov 18, 2024
Nov 18, 2024
Nov 18, 2024
Feb 17, 2025
Feb 17, 2025
Nov 18, 2024
Nov 18, 2024
Dec 17, 2024
Dec 17, 2024
Nov 18, 2024

Repository files navigation

<autodns> for libdns

Go Reference

This package implements the libdns interfaces for <autodns>, allowing you to manage DNS records.

Example:

package main

import (
	"context"
	"os"
	"log"

	"github.com/libdns/autodns"
)

func main() {
	provider := autodns.Provider{
		Username: os.Getenv("AUTODNS_USERNAME"),
		Password: os.Getenv("AUTODNS_PASSWORD"),
	}

	records, err := provider.GetRecords(context.TODO(), "zone.example.org")
	if err != nil {
		log.Fatalf("unexpected error: %s", err)
	}

	fmt.Printf("%#v", records)
}

As an alternative, configure the provider struct with the following:

Field Description (default) Required
 Username username, empty yes
 Password password, empty yes
 Endpoint https://api.autodns.com/v1 no
 Context 4 no
 HttpClient &http.Client{} no