Domainname.shop DNS for libdns
This package implements the libdns interfaces for Domainname.shop DNS.
Side note: This provider has ended up with a few different names so just a bit of clarification.
The company name is Domeneshop AS (Norwegian company).
The main name in Norwegian is "Domeneshop" while in most English context they go by "Domainnameshop".
Some known URLs aredomeneshop.no
,domene.shop
,domainnameshop.com
,domainname.shop
.
Package has used the namedomainnameshop
as reference.
You will need a API token and API secret to use this module.
You can get tokens and secrets from the admin panel here:
https://domene.shop/admin?view=api
This is a minimal example, but you can also check provider_test.go for more usage.
package main
import (
"context"
"fmt"
"os"
"time"
"github.com/libdns/domainnameshop"
)
func main() {
token := os.Getenv("LIBDNS_DOMAINNAMESHOP_TOKEN")
if token == "" {
fmt.Printf("LIBDNS_DOMAINNAMESHOP_TEST_TOKEN not set\n")
return
}
secret := os.Getenv("LIBDNS_DOMAINNAMESHOP_SECRET")
if secret == "" {
fmt.Printf("LIBDNS_DOMAINNAMESHOP_SECRET not set\n")
return
}
zone := os.Getenv("LIBDNS_DOMAINNAMESHOP_ZONE")
if zone == "" {
fmt.Printf("LIBDNS_DOMAINNAMESHOP_ZONE not set\n")
return
}
p := &domainnameshop.Provider{
APIToken: token,
APISecret: secret,
}
ctx, ctxcancel := context.WithTimeout(context.Background(), time.Duration(15*time.Second))
records, err := p.GetRecords(ctx, zone)
if err != nil {
fmt.Printf("Error: %s", err.Error())
return
}
_ = ctxcancel
fmt.Println(records)
}