Skip to content

wizardrix/libdns_netcup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

netcup for libdns

This repository is not maintained, please refer to this repository.

Go Reference

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

Configuration

The provider is configured by instantiating the netcup.Provider with the customer number, the API key and the API password for the DNS API obtained from netcup (guide). Here is a minimal working example to get all DNS records using environment variables for the credentials:

import (
	"context"
	"fmt"
	"os"

	"github.com/libdns/netcup"
)

func main() {
	provider := netcup.Provider{
		CustomerNumber: os.Getenv("LIBDNS_NETCUP_CUSTOMER_NUMBER"),
		APIKey:         os.Getenv("LIBDNS_NETCUP_API_KEY"),
		APIPassword:    os.Getenv("LIBDNS_NETCUP_API_PASSWORD"),
	}
	ctx := context.TODO()
	zone := os.Getenv("LIBDNS_NETCUP_ZONE")

	records, err := provider.GetRecords(ctx, zone)
	if err != nil {
		fmt.Println(err.Error())
		return
	}
	for _, record := range records {
		fmt.Printf("%+v\n", record)
	}
}

About

Netcup provider implementation for libdns

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages