This package implements the libdns interfaces for the Netnod Primary DNS API.
To authenticate, you need a Netnod API token. Generate one through the Netnod customer portal and ensure your client IP is within the configured prefix range.
provider := &netnod.Provider{
APIToken: "your-api-token",
}
records, err := provider.GetRecords(context.Background(), "example.com.")See provider_test.go for more usage examples.
The Netnod API enforces rate limiting (HTTP 429). This provider automatically retries
rate-limited requests using exponential backoff, respecting the Retry-After header when
present. It is important to set a deadline on the context to avoid retrying indefinitely:
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
records, err := provider.GetRecords(ctx, "example.com.")The Netnod API operates on RRsets (all records sharing a name and type). A single TTL applies to the entire RRset. If multiple records with the same name and type specify different TTLs, only the first value is used.
Updates are not atomic across processes. Concurrent modifications from multiple processes to the same RRset may result in inconsistent state. To avoid conflicts, ensure that concurrent processes operate on different RRsets.
Run integration tests against a live Netnod account:
NETNOD_API_TOKEN=your-token NETNOD_TEST_ZONE=example.com. go test -race -v ./...BSD 3-Clause