DNS::LDNS::Zone(3)

πŸ’– DNS::LDNS::Zone πŸ’–

okay so bestie, welcome to the DNS::LDNS::Zone page β€” it's from the User Contributed Perl Documentation collection, and the manual name itself is DNS::LDNS::Zone(3), which is honestly giving very "I know my way around a zonefile" energy. πŸŽ€


✨ NAME ✨

DNS::LDNS::Zone β€” a parsed zonefile. that's it, that's the whole vibe. it's literally your zonefile, but parsed and ready to be cute with. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole little choreography, bestie. look, don't touch yet:

use DNS::LDNS ':all'

my z = new DNS::LDNS::Zone(
  filename => '/path/to/myzone',
  origin => new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'myzone'), #optional
  default_ttl => 3600, #optional
  class => LDNS_RR_CLASS_IN, #optional
)
my z = new DNS::LDNS::Zone(
  file => \*FILE,
  origin => ..., default_ttl => ..., class => ...
)
my z = new DNS::LDNS::Zone

z->to_string
z->print(\*FILE)
z->canonicalize
z->sort
rr = z->soa
z->set_soa(rr)
rrlist = z->rrs
z->set_rrs(rrlist)
z->sign(keylist)
z->sign_nsec3(keylist, algorithm, flags, iterations, salt)

so basically you've got three ways to make a zone:

  • from a filename, with an optional origin (a DNS::LDNS::RData built from LDNS_RDF_TYPE_DNAME and 'myzone' in the example), an optional default_ttl of 3600, and an optional class of LDNS_RR_CLASS_IN β€” all three marked #optional in the source, periodt.
  • from an already-open file handle, like \*FILE, with the same origin, default_ttl and class crew tagging along.
  • or like, literally nothing. my z = new DNS::LDNS::Zone and you're off. main character energy.

and then all the methods you can call on your little zone baby: z->to_string, z->print(\*FILE), z->canonicalize, z->sort, rr = z->soa, z->set_soa(rr), rrlist = z->rrs, z->set_rrs(rrlist), z->sign(keylist), and z->sign_nsec3(keylist, algorithm, flags, iterations, salt). iconic. 🫢


🌈 SEE ALSO 🌈

go look at the project page, it's right here bestie:

http://www.nlnetlabs.nl/projects/ldns


πŸ‘‘ AUTHOR πŸ‘‘

this gorgeous work is by Erik Pihl Ostlyngen, <erik.ostlyngen@uninett.no> β€” we love a credited king. 🌟


Copyright (C) 2013 by UNINETT Norid AS

and listen, the legal bit matters so here it is in full:

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.

no cap, that's the whole license situation. πŸ’–


and that's the page, bestie!! this version of the docs ships with perl v5.42.2 and was dated 2026-06-11 β€” so yeah, that's your footer, cute little timestamp and all. go forth and parse your zonefiles, you absolute legend. πŸ¦‹βœ¨πŸ’…

πŸ“¦ where this page comes from