NameSilo DNS for libdns
This package implements the libdns interfaces for the NameSilo DNS API, allowing you to manage DNS records.
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.
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)
}