NAME

WWW::Hetzner::Cloud::Zone - Hetzner Cloud DNS Zone object

VERSION

version 0.002

SYNOPSIS

my $zone = $cloud->zones->get($id);

# Read attributes
print $zone->id, "\n";
print $zone->name, "\n";
print $zone->status, "\n";
print $zone->ttl, "\n";

# Update
$zone->name('newdomain.com');
$zone->labels({ env => 'prod' });
$zone->update;

# Access RRSets (DNS records)
my $rrsets = $zone->rrsets;
my $records = $rrsets->list;
$rrsets->add_a('www', '1.2.3.4');

# Export as zone file
my $zonefile = $zone->export;

# Delete
$zone->delete;

DESCRIPTION

This class represents a Hetzner Cloud DNS zone. Objects are returned by WWW::Hetzner::Cloud::API::Zones methods.

id

Zone ID (read-only).

name

Zone name / domain (read-write).

status

Zone status: verified, pending, failed (read-only).

ttl

Default TTL for records (read-write).

created

Creation timestamp (read-only).

ns

Nameservers arrayref (read-only).

records_count

Number of records in the zone (read-only).

is_secondary_dns

Whether this is a secondary DNS zone (read-only).

labels

Labels hash (read-write).

update

$zone->name('newdomain.com');
$zone->update;

Saves changes to name and labels back to the API.

delete

$zone->delete;

Deletes the zone and all its records.

rrsets

my $rrsets = $zone->rrsets;

Returns a WWW::Hetzner::Cloud::API::RRSets object for managing DNS records.

export

my $zonefile = $zone->export;

Exports the zone as a standard zone file format.

data

my $hashref = $zone->data;

Returns all zone data as a hashref (for JSON serialization).

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-www-hetzner/issues.

IRC

Join #kubernetes on irc.perl.org or message Getty directly.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.