Skip to content
/ alidns Public

Alibaba Cloud DNS (AliDNS) provider for libdns

License

Notifications You must be signed in to change notification settings

libdns/alidns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6b14285 · Apr 8, 2025

History

36 Commits
May 3, 2021
Oct 19, 2020
Mar 31, 2025
Mar 31, 2025
Jun 28, 2023
Apr 8, 2025
Apr 8, 2025
Apr 8, 2025
Apr 8, 2025
Apr 8, 2025
Apr 8, 2025

Repository files navigation

AliDNS for libdns

Go Reference

This package implements the libdns interfaces, allowing you to manage DNS records with the AliDNS API ( which has a nice Go SDK implementation here )

Authenticating

To authenticate you need to supply our AccessKeyId and AccessKeySecret to the Provider.

Example

Here's a minimal example of how to get all your DNS records using this libdns provider

package main

import (
        "context"
        "fmt"
        "github.com/libdns/alidns"
)

func main() {
        provider := alidns.Provider{
               AccKeyID: "<AccessKeyId form your aliyun console>",
               AccKeySecret: "<AccessKeySecret form your aliyun console>",
        }

        records, err  := provider.GetRecords(context.TODO(), "example.com")
        if err != nil {
                fmt.Println(err.Error())
        }

        for _, record := range records {
                fmt.Printf("%s %v %s %s\n", record.Name, record.TTL.Seconds(), record.Type, record.Value)
        }
}

For complete demo check _demo/demo.go