Skip to content

feat(p/PRIMEDNS): new provider - #5048

Draft
voyo wants to merge 1 commit into
DNSControl:mainfrom
voyo:pr-primedns
Draft

voyo wants to merge 1 commit into
DNSControl:mainfrom
voyo:pr-primedns

Conversation

@voyo

@voyo voyo commented Oct 28, 2026

Copy link
Copy Markdown

Adds a DNS provider for PrimeDNS (PRIMEDNS). I run PrimeDNS and will maintain this provider.

Please create the GitHub label provider-PRIMEDNS.

What it does

  • DNS provider using the PrimeDNS REST API (https://api.primedns.net/v1), diff2.ByRecord.
  • creds.json: api_key (required), api_url (optional).
  • Supported types: A, AAAA, ALIAS, CAA, CNAME, DNAME, DS, HTTPS, LOC, MX, NAPTR, NS, OPENPGPKEY, PTR, SRV, SSHFP, SVCB, TLSA, TXT.
  • Implements ZoneLister and ZoneCreator. get-zones, create-zones and preview/push work.
  • The key only needs the scopes dns:read and dns:write. If the key cannot list zones through /domains, the zone list is built from the records it can read (so a key limited to some zones works).
  • Records PrimeDNS manages itself (SOA, apex NS that point at its own name servers) and CDS, CDNSKEY and URI are not shown to DNSControl. Rows with an empty type (empty non-terminals) are skipped.
  • Rate limit: retries on 429 and 502/503/504, honoring Retry-After. CanConcur is Cannot.
  • auditrecords.go rejects only what the API refuses: null MX, empty TXT, TTL outside 60-86400, and an extra apex NS record whose TTL differs from PrimeDNS's own (8000 s). The API keeps one TTL per name and type (RFC 2181 section 5.2); the audit message tells the user to add TTL(8000).

Testing

  • Unit tests: go test ./providers/primedns/ (record conversion, TXT, MX/SRV priority, SRV null target, SVCB/HTTPS params, empty non-terminals, zone listing without the domains:read scope, apex NS TTL audit).
  • Integration test against the live API (go test ./integrationTest -args -profile PRIMEDNS), last run on this branch rebased on main at 148c2d4: 317 passed, 0 failed, 64 skipped. The skipped tests are types and features this provider does not declare (RP, SMIMEA, CSYNC, DHCID, DNSKEY, SOA and the pseudo-types of other providers) and the cases rejected by auditrecords.go.
  • Also run through the CLI against a real zone: push of 29 records of 20 types, a second push gives 0 corrections, get-zones then preview of the result gives 0, and changes, TTL changes and deletions work.
  • The manual TXT quote test from testing-txt-records.md: PrimeDNS reads a value that starts with a double quote as zone-file notation, so "test2" created in the portal is served as test2; DNSControl sends literal quotes in escaped form and they come back unchanged (documented in primedns.md).
  • bin/generate-all.sh, staticcheck and golangci-lint are clean.

CI

The integration test needs a PrimeDNS API key and a zone whose records can be deleted. I added the PRIMEDNS_* variables to pr_integration_tests.yml as described in the provider guide. I can provide a key and a test zone for the project's own secrets if you want PrimeDNS covered by the automated runs, or leave it out of CI.

Notes

  • get-zones --format=js writes HTTPS and SVCB parameters as [h2,h3] instead of a quoted string; this is not specific to this provider (BIND gives the same), I will report it separately.

@TomOnTime

Copy link
Copy Markdown
Collaborator

Hello friend!

Thanks for submitting this! It looks good so far. I'm having a very busy week and might not be able to finish the review until next week. Thank you for understanding.

@voyo

voyo commented Nov 1, 2026

Copy link
Copy Markdown
Author

Sure, understand. Take your time.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants