dnscontrol/providers/_all/all.go
Jakob Ackermann 1e67585e8f
HETZNER_V2: Add provider for Hetzner DNS API (#3837)
Closes https://github.com/StackExchange/dnscontrol/issues/3787

This PR is adding a `HETZNER_V2` provider for the "new" Hetzner DNS API.

Testing:
- The integration tests are passing.
- Manual testing:
  - `preview` (see diff for existing zone)
- `preview --populate-on-preview` (see full diff for newly created zone)
  - `push` (see full diff; no diff after push)
- `push` (see full diff; no diff after push to newly created zone --
i.e. single pass and done)

```js
var REG_NONE = NewRegistrar('none')
var DSP = NewDnsProvider('HETZNER_V2')

D('testing-2025-11-14-7.dev', REG_NONE, DnsProvider(DSP),
    A('@', '127.0.0.1')
)
```

<details>

```
# push for newly created zone
CONCURRENTLY checking for 1 zone(s)
SERIALLY checking for 0 zone(s)
Waiting for concurrent checking(s) to complete...DONE
******************** Domain: testing-2025-11-14-7.dev
1 correction (HETZNER_V2)
#1: Ensuring zone "testing-2025-11-14-7.dev" exists in "HETZNER_V2"
SUCCESS!
CONCURRENTLY gathering records of 1 zone(s)
SERIALLY gathering records of 0 zone(s)
Waiting for concurrent gathering(s) to complete...DONE
******************** Domain: testing-2025-11-14-7.dev
4 corrections (HETZNER_V2)
#1: ± MODIFY-TTL testing-2025-11-14-7.dev NS helium.ns.hetzner.de. ttl=(3600->300)
± MODIFY-TTL testing-2025-11-14-7.dev NS hydrogen.ns.hetzner.com. ttl=(3600->300)
± MODIFY-TTL testing-2025-11-14-7.dev NS oxygen.ns.hetzner.com. ttl=(3600->300)
SUCCESS!
#2: + CREATE testing-2025-11-14-7.dev A 127.0.0.1 ttl=300
SUCCESS!
Done. 5 corrections.
```
</details>

Feedback for @jooola and @LKaemmerling:
- The SDK was very useful in getting 80% there! Nice! 🎉 
- Footgun:
- The `result` values are not "up-to-date" after waiting for an
`Action`, e.g. `Zone.AuthoritativeNameservers.Assigned` is not set when
`Client.Zone.Create()` returns and the following "wait" will not update
it.
- Taking a step back here: Waiting for an `Action` with a separate SDK
call does not seem very natural to me. Does the SDK-user need to know
that you are processing operations asynchronous? (Which seems like an
implementation detail to me, something that the SDK could abstrct over.)
Can `Client.Zone.Create()` return the final `Zone` instead of the
intermediate result?
- Features missing compared to the DNS Console, in priority order:
- It is no longer possible to remove your provided name servers from the
root/apex. Use-case: dual-home/multi-home zone with fewer than three
servers from Hetzner. I'm operating one of these and cannot migrate over
until this is fixed.
- Performance regression due to lack of bulk create/modify. E.g. [one of
the test
suites](a71b89e5a2/integrationTest/integration_test.go (L619))
spends about 4.5 minutes on making creating 100 record-sets and then
another 4 minutes for deleting them in sequence again. With your async
API, these are `create 2*100 + delete 2*100 = 400` API calls.
Previously, these were `create 1 + delete 100 = 101` API calls. Are you
planning on adding batch processing again?
- Usability nits
- Compared to other record-set based APIs, upserts for record-sets are
missing. This applies to records of a record-set and the ttl of the
record-set (see separate SDK calls for the cases `diff2.CREATE` vs
`diff2.CHANGE` and two calls in `diff2.CHANGE` for updating the TTL vs
records).
- Some SDK methods return an `Action` (e.g. `Zone.ChangeRRSetTTL()`),
others wrap the `Action` in a struct (`Client.Zone.CreateRRSet()`) --
even when the struct has a single field (`ZoneRRSetDeleteResult`).

---------

Co-authored-by: "Jonas L." <jooola@users.noreply.github.com>
Co-authored-by: "Lukas Kämmerling" <LKaemmerling@users.noreply.github.com>
Co-authored-by: Tom Limoncelli <6293917+tlimoncelli@users.noreply.github.com>
2025-11-30 09:14:54 -05:00

62 lines
3.7 KiB
Go

// Package all is simply a container to reference all known provider implementations for easy import into other packages
package all
import (
// Define all known providers here. They should each register themselves with the providers package via init function.
_ "github.com/StackExchange/dnscontrol/v4/providers/adguardhome"
_ "github.com/StackExchange/dnscontrol/v4/providers/akamaiedgedns"
_ "github.com/StackExchange/dnscontrol/v4/providers/autodns"
_ "github.com/StackExchange/dnscontrol/v4/providers/axfrddns"
_ "github.com/StackExchange/dnscontrol/v4/providers/azuredns"
_ "github.com/StackExchange/dnscontrol/v4/providers/azureprivatedns"
_ "github.com/StackExchange/dnscontrol/v4/providers/bind"
_ "github.com/StackExchange/dnscontrol/v4/providers/bunnydns"
_ "github.com/StackExchange/dnscontrol/v4/providers/cloudflare"
_ "github.com/StackExchange/dnscontrol/v4/providers/cloudns"
_ "github.com/StackExchange/dnscontrol/v4/providers/cnr"
_ "github.com/StackExchange/dnscontrol/v4/providers/cscglobal"
_ "github.com/StackExchange/dnscontrol/v4/providers/desec"
_ "github.com/StackExchange/dnscontrol/v4/providers/digitalocean"
_ "github.com/StackExchange/dnscontrol/v4/providers/dnsimple"
_ "github.com/StackExchange/dnscontrol/v4/providers/dnsmadeeasy"
_ "github.com/StackExchange/dnscontrol/v4/providers/doh"
_ "github.com/StackExchange/dnscontrol/v4/providers/domainnameshop"
_ "github.com/StackExchange/dnscontrol/v4/providers/dynadot"
_ "github.com/StackExchange/dnscontrol/v4/providers/easyname"
_ "github.com/StackExchange/dnscontrol/v4/providers/exoscale"
_ "github.com/StackExchange/dnscontrol/v4/providers/fortigate"
_ "github.com/StackExchange/dnscontrol/v4/providers/gandiv5"
_ "github.com/StackExchange/dnscontrol/v4/providers/gcloud"
_ "github.com/StackExchange/dnscontrol/v4/providers/gcore"
_ "github.com/StackExchange/dnscontrol/v4/providers/hedns"
_ "github.com/StackExchange/dnscontrol/v4/providers/hetzner"
_ "github.com/StackExchange/dnscontrol/v4/providers/hetznerv2"
_ "github.com/StackExchange/dnscontrol/v4/providers/hexonet"
_ "github.com/StackExchange/dnscontrol/v4/providers/hostingde"
_ "github.com/StackExchange/dnscontrol/v4/providers/huaweicloud"
_ "github.com/StackExchange/dnscontrol/v4/providers/internetbs"
_ "github.com/StackExchange/dnscontrol/v4/providers/inwx"
_ "github.com/StackExchange/dnscontrol/v4/providers/joker"
_ "github.com/StackExchange/dnscontrol/v4/providers/linode"
_ "github.com/StackExchange/dnscontrol/v4/providers/loopia"
_ "github.com/StackExchange/dnscontrol/v4/providers/luadns"
_ "github.com/StackExchange/dnscontrol/v4/providers/mythicbeasts"
_ "github.com/StackExchange/dnscontrol/v4/providers/namecheap"
_ "github.com/StackExchange/dnscontrol/v4/providers/namedotcom"
_ "github.com/StackExchange/dnscontrol/v4/providers/netcup"
_ "github.com/StackExchange/dnscontrol/v4/providers/netlify"
_ "github.com/StackExchange/dnscontrol/v4/providers/ns1"
_ "github.com/StackExchange/dnscontrol/v4/providers/opensrs"
_ "github.com/StackExchange/dnscontrol/v4/providers/oracle"
_ "github.com/StackExchange/dnscontrol/v4/providers/ovh"
_ "github.com/StackExchange/dnscontrol/v4/providers/packetframe"
_ "github.com/StackExchange/dnscontrol/v4/providers/porkbun"
_ "github.com/StackExchange/dnscontrol/v4/providers/powerdns"
_ "github.com/StackExchange/dnscontrol/v4/providers/realtimeregister"
_ "github.com/StackExchange/dnscontrol/v4/providers/route53"
_ "github.com/StackExchange/dnscontrol/v4/providers/rwth"
_ "github.com/StackExchange/dnscontrol/v4/providers/sakuracloud"
_ "github.com/StackExchange/dnscontrol/v4/providers/softlayer"
_ "github.com/StackExchange/dnscontrol/v4/providers/transip"
_ "github.com/StackExchange/dnscontrol/v4/providers/vultr"
)