https://github.com/libdns/namesilo
https://github.com/libdns/namesilo
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/libdns/namesilo
- Owner: libdns
- License: mit
- Created: 2022-06-14T19:45:38.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2025-05-02T16:28:54.000Z (about 1 year ago)
- Last Synced: 2025-12-07T23:09:25.309Z (6 months ago)
- Language: Go
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
NameSilo DNS for [`libdns`](https://github.com/libdns/libdns)
=======================
[](https://pkg.go.dev/github.com/libdns/namesilo)
This package implements the [libdns interfaces](https://github.com/libdns/libdns) for the [NameSilo DNS API](https://www.namesilo.com/api-reference), 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.
```go
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)
}
```