Skip to content

Latest commit

 

History

60 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bluecat for libdns

Go Reference

This package implements the libdns interfaces for Bluecat Address Manager, allowing you to manage DNS records.

Configuration

To use this provider, you need:

  • Bluecat Address Manager API endpoint (URL)
  • Username
  • Password

Example Usage

package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libdns/bluecat"
	"github.com/libdns/libdns"
)

func main() {
	provider := &bluecat.Provider{
		ServerURL: "https://bluecat.example.com",
		Username:  "api_user",
		Password:  "api_password",
		// Optional: specify configuration and view names
		// ConfigurationName: "config",
		// ViewName: "view",
	}

	zone := "example.com."
	ctx := context.Background()

	// Get existing records
	records, err := provider.GetRecords(ctx, zone)
	if err != nil {
		panic(err)
	}
	fmt.Printf("Found %d records\n", len(records))

	// Append a new A record
	newRecords := []libdns.Record{
		libdns.Address{
			Name: "test",
			TTL:  300 * time.Second,
			IP:   netip.MustParseAddr("192.0.2.1"),
		},
	}
	
	created, err := provider.AppendRecords(ctx, zone, newRecords)
	if err != nil {
		panic(err)
	}
	fmt.Printf("Created %d records\n", len(created))
}

Caveats

  • The provider requires Bluecat Address Manager 9.5.0 or later with the RESTful v2 API enabled
  • Record names should be relative to the zone (e.g., "www" for "www.example.com" in zone "example.com.")
  • Handling of Bluecat's linked records is not properly implemented yet. Networks and existing records to link A records and CNAMEs must already exist.

Features

  • Authentication sessions are automatically managed and tokens are cached for efficiency
  • The provider supports A, AAAA, CNAME, TXT, MX, NS, and SRV record types

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages