https://github.com/libdns/he
Hurricane Electric
https://github.com/libdns/he
Last synced: 4 months ago
JSON representation
Hurricane Electric
- Host: GitHub
- URL: https://github.com/libdns/he
- Owner: libdns
- License: mit
- Created: 2024-08-02T19:30:53.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-11-11T20:31:29.000Z (7 months ago)
- Last Synced: 2025-11-11T22:23:07.531Z (7 months ago)
- Language: Go
- Size: 62.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Hurricane Electric for [`libdns`](https://github.com/libdns/libdns)
========================
[](https://pkg.go.dev/github.com/libdns/he)
This package implements the [libdns interfaces](https://github.com/libdns/libdns) for Hurricane Electric,
allowing you to manage DNS records.
This package uses the dynamic DNS feature of Hurricane Electric Hosted DNS.
Configuration
=============
To configure a dynamic DNS record in HE, login to the [HE DNS portal](https://dns.he.net/)
and select the domain to configure the record under.
Add a new A/AAAA/TXT record and select the "Enable entry for dynamic dns" option.
Once the record has been created click the Generate a DDNS key 🗘 button and set a key.
Example
=======
```go
package main
import (
"context"
"fmt"
"os"
"github.com/libdns/he"
"github.com/libdns/libdns"
)
func main() {
key := os.Getenv("LIBDNS_HE_KEY")
if key == "" {
fmt.Println("LIBDNS_HE_KEY not set")
return
}
zone := os.Getenv("LIBDNS_HE_ZONE")
if zone == "" {
fmt.Println("LIBDNS_HE_ZONE not set")
return
}
p := &he.Provider{
APIKey: key,
}
records := []libdns.Record{
{
Type: "A",
Name: "test",
Value: "198.51.100.1",
},
{
Type: "AAAA",
Name: "test",
Value: "2001:0db8::1",
},
{
Type: "TXT",
Name: "test",
Value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
},
}
ctx := context.Background()
_, err := p.SetRecords(ctx, zone, records)
if err != nil {
fmt.Printf("Error: %v", err)
return
}
}
```