Skip to content

libdns/powerdns

Repository files navigation

powerdns provider for libdns

Github Actions Go Reference

This package implements the libdns interfaces for PowerDNS, allowing you to manage DNS records.

This uses mittwald/go-powerdns under the covers to actually talk to powerdns.

To configure this, simply specify the server URL and the access token.

package main

import (
    "context"

    "github.com/libdns/libdns"
    "github.com/libdns/powerdns"
)

func main() {
    p := &powerdns.Provider{
        ServerURL: "http://localhost", // required
        ServerID:  "localhost",        // if left empty, defaults to localhost.
        APIToken:  "asdfasdfasdf",     // required
    }

    _, err := p.AppendRecords(context.Background(), "example.org.", []libdns.Record{
        {
            Name:  "_acme_whatever",
            Type:  "TXT",
            Value: "123456",
        },
    })
    if err != nil {
        panic(err)
    }

}