Skip to content

antonchen/namesilo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NameSilo DNS for libdns

Go Reference

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

Authentication

In order to use NameSilo DNS for libdns, the NameSilo API key is required as the token. One can obtain it on the API Manager page within one's account.

Example

The following example shows how to retrieve the DNS records.

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/libdns/namesilo"
)

func main() {
	token := os.Getenv("LIBDNS_NAMESILO_TOKEN")
	if token == "" {
		fmt.Println("LIBDNS_NAMESILO_TOKEN not set")
		return
	}

	zone := os.Getenv("LIBDNS_NAMESILO_ZONE")
	if token == "" {
		fmt.Println("LIBDNS_NAMESILO_ZONE not set")
		return
	}

	p := &namesilo.Provider{
		AuthAPIToken: token,
	}

	ctx := context.Background()
	records, err := p.GetRecords(ctx, zone)
	if err != nil {
		fmt.Printf("Error: %v", err)
		return
	}

	fmt.Println(records)
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%