Skip to content

This package implements the libdns interfaces for the Linode Domains API.

License

Notifications You must be signed in to change notification settings

tosie/libdns-linode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linode for libdns

Go Reference

This package implements the libdns interfaces for the Linode Domains API.

Authenticating

To authenticate you need to supply a Linode Personal Access Token.

Example

Here's a minimal example of how to get all DNS records for a zone. See also: provider_test.go

package main

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

	"github.com/tosie/libdns-hetzner"
)

func main() {
	token := os.Getenv("LIBDNS_LINODE_TOKEN")
	if token == "" {
		fmt.Printf("LIBDNS_LINODE_TOKEN not set\n")
		return
	}

	zone := os.Getenv("LIBDNS_LINODE_ZONE")
	if token == "" {
		fmt.Printf("LIBDNS_LINODE_ZONE not set\n")
		return
	}

	p := &linode.Provider{
		APIToken: token,
	}

	records, err := p.GetRecords(context.WithTimeout(context.Background(), time.Duration(15*time.Second)), zone)
	if err != nil {
        fmt.Printf("Error: %s", err.Error())
        return
	}

	fmt.Println(records)
}

About

This package implements the libdns interfaces for the Linode Domains API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages