Skip to content

Commit 73199fa

Browse files
authored
feat: DNS support is now generally available (#763)
See https://docs.hetzner.cloud/changelog#2025-11-10-dns-ga for more details.
1 parent 1c85ba0 commit 73199fa

File tree

3 files changed

+0
-165
lines changed

3 files changed

+0
-165
lines changed

hcloud/zone.go

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ func (o *Zone) idOrName() (string, error) {
112112
//
113113
// See https://docs.hetzner.cloud/reference/cloud#zones and
114114
// https://docs.hetzner.cloud/reference/cloud#zone-rrsets.
115-
//
116-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
117-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
118115
type ZoneClient struct {
119116
client *Client
120117
Action *ResourceActionClient
@@ -123,29 +120,20 @@ type ZoneClient struct {
123120
// GetByID returns a single [Zone].
124121
//
125122
// See https://docs.hetzner.cloud/reference/cloud#zones-get-a-zone
126-
//
127-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
128-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
129123
func (c *ZoneClient) GetByID(ctx context.Context, id int64) (*Zone, *Response, error) {
130124
return c.getByIDOrName(ctx, strconv.FormatInt(id, 10))
131125
}
132126

133127
// GetByName returns a single [Zone].
134128
//
135129
// See https://docs.hetzner.cloud/reference/cloud#zones-get-a-zone
136-
//
137-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
138-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
139130
func (c *ZoneClient) GetByName(ctx context.Context, name string) (*Zone, *Response, error) {
140131
return c.getByIDOrName(ctx, name)
141132
}
142133

143134
// Get returns a single [Zone].
144135
//
145136
// See https://docs.hetzner.cloud/reference/cloud#zones-get-a-zone
146-
//
147-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
148-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
149137
func (c *ZoneClient) Get(ctx context.Context, idOrName string) (*Zone, *Response, error) {
150138
return c.getByIDOrName(ctx, idOrName)
151139
}
@@ -191,9 +179,6 @@ func (l ZoneListOpts) values() url.Values {
191179
// List returns a list of [Zone] for a specific page.
192180
//
193181
// See https://docs.hetzner.cloud/reference/cloud#zones-list-zones
194-
//
195-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
196-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
197182
func (c *ZoneClient) List(ctx context.Context, opts ZoneListOpts) ([]*Zone, *Response, error) {
198183
const opPath = "/zones?%s"
199184
ctx = ctxutil.SetOpPath(ctx, opPath)
@@ -211,19 +196,13 @@ func (c *ZoneClient) List(ctx context.Context, opts ZoneListOpts) ([]*Zone, *Res
211196
// All returns a list of all [Zone].
212197
//
213198
// See https://docs.hetzner.cloud/reference/cloud#zones-list-zones
214-
//
215-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
216-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
217199
func (c *ZoneClient) All(ctx context.Context) ([]*Zone, error) {
218200
return c.AllWithOpts(ctx, ZoneListOpts{ListOpts: ListOpts{PerPage: 50}})
219201
}
220202

221203
// AllWithOpts returns a list of all [Zone] with the given options.
222204
//
223205
// See https://docs.hetzner.cloud/reference/cloud#zones-list-zones
224-
//
225-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
226-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
227206
func (c *ZoneClient) AllWithOpts(ctx context.Context, opts ZoneListOpts) ([]*Zone, error) {
228207
return iterPages(func(page int) ([]*Zone, *Response, error) {
229208
opts.Page = page
@@ -271,9 +250,6 @@ type ZoneCreateResult struct {
271250
// Create creates a new [Zone] from the given options.
272251
//
273252
// See https://docs.hetzner.cloud/reference/cloud#zones-create-a-zone
274-
//
275-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
276-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
277253
func (c *ZoneClient) Create(ctx context.Context, opts ZoneCreateOpts) (ZoneCreateResult, *Response, error) {
278254
const opPath = "/zones"
279255
ctx = ctxutil.SetOpPath(ctx, opPath)
@@ -303,9 +279,6 @@ type ZoneUpdateOpts struct {
303279
// Update updates a [Zone] with the given options.
304280
//
305281
// See https://docs.hetzner.cloud/reference/cloud#zones-update-a-zone
306-
//
307-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
308-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
309282
func (c *ZoneClient) Update(ctx context.Context, zone *Zone, opts ZoneUpdateOpts) (*Zone, *Response, error) {
310283
const opPath = "/zones/%s"
311284
ctx = ctxutil.SetOpPath(ctx, opPath)
@@ -335,9 +308,6 @@ type ZoneDeleteResult struct {
335308
// Delete deletes a [Zone].
336309
//
337310
// See https://docs.hetzner.cloud/reference/cloud#zones-delete-a-zone
338-
//
339-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
340-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
341311
func (c *ZoneClient) Delete(ctx context.Context, zone *Zone) (ZoneDeleteResult, *Response, error) {
342312
const opPath = "/zones/%s"
343313
ctx = ctxutil.SetOpPath(ctx, opPath)
@@ -369,9 +339,6 @@ type ZoneExportZonefileResult struct {
369339
// ExportZonefile returns a generated [Zone] file in BIND (RFC 1034/1035) format.
370340
//
371341
// See https://docs.hetzner.cloud/reference/cloud#zones-export-a-zone-file
372-
//
373-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
374-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
375342
func (c *ZoneClient) ExportZonefile(ctx context.Context, zone *Zone) (ZoneExportZonefileResult, *Response, error) {
376343
const opPath = "/zones/%s/zonefile"
377344
ctx = ctxutil.SetOpPath(ctx, opPath)
@@ -403,9 +370,6 @@ type ZoneImportZonefileOpts struct {
403370
// ImportZonefile imports a zone file, replacing all resource record sets (RRSets).
404371
//
405372
// See https://docs.hetzner.cloud/reference/cloud#zone-actions-import-a-zone-file
406-
//
407-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
408-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
409373
func (c *ZoneClient) ImportZonefile(ctx context.Context, zone *Zone, opts ZoneImportZonefileOpts) (*Action, *Response, error) {
410374
const opPath = "/zones/%s/actions/import_zonefile"
411375
ctx = ctxutil.SetOpPath(ctx, opPath)
@@ -435,9 +399,6 @@ type ZoneChangeProtectionOpts struct {
435399
// ChangeProtection changes the protection of a [Zone].
436400
//
437401
// See https://docs.hetzner.cloud/reference/cloud#zone-actions-change-a-zones-protection
438-
//
439-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
440-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
441402
func (c *ZoneClient) ChangeProtection(ctx context.Context, zone *Zone, opts ZoneChangeProtectionOpts) (*Action, *Response, error) {
442403
const opPath = "/zones/%s/actions/change_protection"
443404
ctx = ctxutil.SetOpPath(ctx, opPath)
@@ -467,9 +428,6 @@ type ZoneChangeTTLOpts struct {
467428
// ChangeTTL changes the TTL of a [Zone].
468429
//
469430
// See https://docs.hetzner.cloud/reference/cloud#zone-actions-change-a-zones-default-ttl
470-
//
471-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
472-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
473431
func (c *ZoneClient) ChangeTTL(ctx context.Context, zone *Zone, opts ZoneChangeTTLOpts) (*Action, *Response, error) {
474432
const opPath = "/zones/%s/actions/change_ttl"
475433
ctx = ctxutil.SetOpPath(ctx, opPath)
@@ -509,9 +467,6 @@ type ZoneChangePrimaryNameserversOptsPrimaryNameserver struct {
509467
// ChangePrimaryNameservers changes the primary nameservers of a [Zone].
510468
//
511469
// See https://docs.hetzner.cloud/reference/cloud#zone-actions-change-a-zones-primary-nameservers
512-
//
513-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
514-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
515470
func (c *ZoneClient) ChangePrimaryNameservers(ctx context.Context, zone *Zone, opts ZoneChangePrimaryNameserversOpts) (*Action, *Response, error) {
516471
const opPath = "/zones/%s/actions/change_primary_nameservers"
517472
ctx = ctxutil.SetOpPath(ctx, opPath)

hcloud/zone_rrset.go

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ func (o *ZoneRRSet) nameAndType() (string, ZoneRRSetType, error) {
8181
// GetRRSetByNameAndType returns a single [ZoneRRSet].
8282
//
8383
// See https://docs.hetzner.cloud/reference/cloud#zone-rrsets-get-an-rrset
84-
//
85-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
86-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
8784
func (c *ZoneClient) GetRRSetByNameAndType(ctx context.Context, zone *Zone, rrsetName string, rrsetType ZoneRRSetType) (*ZoneRRSet, *Response, error) {
8885
const opPath = "/zones/%s/rrsets/%s/%s"
8986
ctx = ctxutil.SetOpPath(ctx, opPath)
@@ -109,9 +106,6 @@ func (c *ZoneClient) GetRRSetByNameAndType(ctx context.Context, zone *Zone, rrse
109106
// GetRRSetByID returns a single [ZoneRRSet].
110107
//
111108
// See https://docs.hetzner.cloud/reference/cloud#zone-rrsets-get-an-rrset
112-
//
113-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
114-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
115109
func (c *ZoneClient) GetRRSetByID(ctx context.Context, zone *Zone, rrsetID string) (*ZoneRRSet, *Response, error) {
116110
rrsetName, rrsetType, ok := strings.Cut(rrsetID, "/")
117111
if !ok {
@@ -146,9 +140,6 @@ func (l ZoneRRSetListOpts) values() url.Values {
146140
// ListRRSets returns a list of [ZoneRRSet] for a specific page.
147141
//
148142
// See https://docs.hetzner.cloud/reference/cloud#zone-rrsets-list-rrsets
149-
//
150-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
151-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
152143
func (c *ZoneClient) ListRRSets(ctx context.Context, zone *Zone, opts ZoneRRSetListOpts) ([]*ZoneRRSet, *Response, error) {
153144
const opPath = "/zones/%s/rrsets?%s"
154145
ctx = ctxutil.SetOpPath(ctx, opPath)
@@ -171,9 +162,6 @@ func (c *ZoneClient) ListRRSets(ctx context.Context, zone *Zone, opts ZoneRRSetL
171162
// AllRRSetsWithOpts returns a list of all [ZoneRRSet] with the given options.
172163
//
173164
// See https://docs.hetzner.cloud/reference/cloud#zone-rrsets-list-rrsets
174-
//
175-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
176-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
177165
func (c *ZoneClient) AllRRSetsWithOpts(ctx context.Context, zone *Zone, opts ZoneRRSetListOpts) ([]*ZoneRRSet, error) {
178166
return iterPages(func(page int) ([]*ZoneRRSet, *Response, error) {
179167
opts.Page = page
@@ -184,9 +172,6 @@ func (c *ZoneClient) AllRRSetsWithOpts(ctx context.Context, zone *Zone, opts Zon
184172
// AllRRSets returns a list of all [ZoneRRSet].
185173
//
186174
// See https://docs.hetzner.cloud/reference/cloud#zone-rrsets-list-rrsets
187-
//
188-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
189-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
190175
func (c *ZoneClient) AllRRSets(ctx context.Context, zone *Zone) ([]*ZoneRRSet, error) {
191176
return c.AllRRSetsWithOpts(ctx, zone, ZoneRRSetListOpts{ListOpts: ListOpts{PerPage: 50}})
192177
}
@@ -209,9 +194,6 @@ type ZoneRRSetCreateResult struct {
209194
// CreateRRSet creates a new [ZoneRRSet] from the given options.
210195
//
211196
// See https://docs.hetzner.cloud/reference/cloud#zone-rrsets-create-an-rrset
212-
//
213-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
214-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
215197
func (c *ZoneClient) CreateRRSet(ctx context.Context, zone *Zone, opts ZoneRRSetCreateOpts) (ZoneRRSetCreateResult, *Response, error) {
216198
const opPath = "/zones/%s/rrsets"
217199
ctx = ctxutil.SetOpPath(ctx, opPath)
@@ -246,9 +228,6 @@ type ZoneRRSetUpdateOpts struct {
246228
// UpdateRRSet updates a [ZoneRRSet] with the given options.
247229
//
248230
// See https://docs.hetzner.cloud/reference/cloud#zone-rrsets-update-an-rrset
249-
//
250-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
251-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
252231
func (c *ZoneClient) UpdateRRSet(ctx context.Context, rrset *ZoneRRSet, opts ZoneRRSetUpdateOpts) (*ZoneRRSet, *Response, error) {
253232
const opPath = "/zones/%s/rrsets/%s/%s"
254233
ctx = ctxutil.SetOpPath(ctx, opPath)
@@ -287,9 +266,6 @@ type ZoneRRSetDeleteResult struct {
287266
// DeleteRRSet deletes a [ZoneRRSet].
288267
//
289268
// See https://docs.hetzner.cloud/reference/cloud#zone-rrsets-delete-an-rrset
290-
//
291-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
292-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
293269
func (c *ZoneClient) DeleteRRSet(ctx context.Context, rrset *ZoneRRSet) (ZoneRRSetDeleteResult, *Response, error) {
294270
const opPath = "/zones/%s/rrsets/%s/%s"
295271
ctx = ctxutil.SetOpPath(ctx, opPath)
@@ -330,9 +306,6 @@ type ZoneRRSetChangeProtectionOpts struct {
330306
// ChangeRRSetProtection changes the protection of a [ZoneRRSet].
331307
//
332308
// See https://docs.hetzner.cloud/reference/cloud#zone-rrset-actions-change-an-rrsets-protection
333-
//
334-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
335-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
336309
func (c *ZoneClient) ChangeRRSetProtection(ctx context.Context, rrset *ZoneRRSet, opts ZoneRRSetChangeProtectionOpts) (*Action, *Response, error) {
337310
const opPath = "/zones/%s/rrsets/%s/%s/actions/change_protection"
338311
ctx = ctxutil.SetOpPath(ctx, opPath)
@@ -371,9 +344,6 @@ type ZoneRRSetChangeTTLOpts struct {
371344
// ChangeRRSetTTL changes the TTL of a [ZoneRRSet].
372345
//
373346
// See https://docs.hetzner.cloud/reference/cloud#zone-rrset-actions-change-an-rrsets-ttl
374-
//
375-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
376-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
377347
func (c *ZoneClient) ChangeRRSetTTL(ctx context.Context, rrset *ZoneRRSet, opts ZoneRRSetChangeTTLOpts) (*Action, *Response, error) {
378348
const opPath = "/zones/%s/rrsets/%s/%s/actions/change_ttl"
379349
ctx = ctxutil.SetOpPath(ctx, opPath)
@@ -412,9 +382,6 @@ type ZoneRRSetSetRecordsOpts struct {
412382
// SetRRSetRecords overwrites the records of a [ZoneRRSet].
413383
//
414384
// See https://docs.hetzner.cloud/reference/cloud#zone-rrset-actions-set-records-of-an-rrset
415-
//
416-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
417-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
418385
func (c *ZoneClient) SetRRSetRecords(ctx context.Context, rrset *ZoneRRSet, opts ZoneRRSetSetRecordsOpts) (*Action, *Response, error) {
419386
const opPath = "/zones/%s/rrsets/%s/%s/actions/set_records"
420387
ctx = ctxutil.SetOpPath(ctx, opPath)
@@ -454,9 +421,6 @@ type ZoneRRSetAddRecordsOpts struct {
454421
// AddRRSetRecords adds records to a [ZoneRRSet].
455422
//
456423
// See https://docs.hetzner.cloud/reference/cloud#zone-rrset-actions-add-records-to-an-rrset
457-
//
458-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
459-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
460424
func (c *ZoneClient) AddRRSetRecords(ctx context.Context, rrset *ZoneRRSet, opts ZoneRRSetAddRecordsOpts) (*Action, *Response, error) {
461425
const opPath = "/zones/%s/rrsets/%s/%s/actions/add_records"
462426
ctx = ctxutil.SetOpPath(ctx, opPath)
@@ -495,9 +459,6 @@ type ZoneRRSetRemoveRecordsOpts struct {
495459
// RemoveRRSetRecords removes records from a [ZoneRRSet].
496460
//
497461
// See https://docs.hetzner.cloud/reference/cloud#zone-rrset-actions-remove-records-from-an-rrset
498-
//
499-
// Experimental: DNS API is in beta, breaking changes may occur within minor releases.
500-
// See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta
501462
func (c *ZoneClient) RemoveRRSetRecords(ctx context.Context, rrset *ZoneRRSet, opts ZoneRRSetRemoveRecordsOpts) (*Action, *Response, error) {
502463
const opPath = "/zones/%s/rrsets/%s/%s/actions/remove_records"
503464
ctx = ctxutil.SetOpPath(ctx, opPath)

0 commit comments

Comments
 (0)