INWX for libdns
This package implements the libdns interfaces for INWX, allowing you to manage DNS records.
This provider uses the JSON-RPC API, which is described in the official documentation.
To authenticate you need to supply following credentials:
- Your INWX username
- Your INWX password
- A shared secret if you have enabled Mobile TAN (two-factor authentication)
package main
import (
"context"
"fmt"
"github.com/libdns/inwx"
)
func main() {
provider := &inwx.Provider{
Username: "<username>",
Password: "<password>",
SharedSecret: "<sharedSecret>",
// Uncomment the following line, if the test environment should be used:
// EndpointURL: "https://api.ote.domrobot.com/jsonrpc/"
}
zone := "example.com."
records, err := provider.GetRecords(context.TODO(), zone)
if err != nil {
fmt.Printf("Error: %s", err.Error())
return
}
fmt.Println(records)
}