Zonema...::Zone(3pm)

πŸ’– Zonemaster::Engine::Zone β€” the it-girl of DNS zones πŸ’–

okay so this is the <pink>User Contributed Perl Documentation</pink> page for Zonemaster::Engine::Zone, manual section 3pm, bestie. Yes the header literally renders as Zonema...::Zone(3pm) because terminals are dramatic and truncate things, but it's her, it's the Zonemaster::Engine zone object. come sit with me 🫢


✨ NAME ✨

Zonemaster::Engine::Zone β€” an object that represents a DNS zone, no cap πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

my $zone = Zonemaster::Engine::Zone->new({ name => 'nic.se' });
my $packet = $zone->parent->query_one($zone->name, 'NS');

literally that's it. two lines. she's lowkey elegant like that πŸ’…


🌸 DESCRIPTION 🌸

So. Objects of this class represent zones in DNS. As much as humanly possible, test implementations should get their info about zones through these objects, not by going rogue and doing their own thing. Because when you go through the object you get:

  • lazy-loading of the information (she loads it when she feels like it, and honestly? respect)
  • well-defined methods where the information actually gets fetched
  • logging
  • and the ability to do stuff like testing zones that haven't even been delegated yet ✨

πŸŽ€ CONSTRUCTORS πŸŽ€

  • new β€” Construct a brand new instance. Baby's first zone object. slay.

🌈 ATTRIBUTES 🌈

  • name β€” A Zonemaster::Engine::DNSName object representing the name of the zone. that's her name, that's her whole identity.
  • parent β€” A Zonemaster::Engine::Zone object for this domain's parent domain. Special case alert: the root zone is considered to be its own parent. yes, she's her own mother, main character energy fr. so if you're recursing up the tree, look out for that or you'll be in a loop forever, and not the cute kind 😭
  • ns_names β€” A reference to an array of Zonemaster::Engine::DNSName objects, holding the names of the nameservers for the domain, as returned by the first responding nameserver in the glue list. it's giving "who even are you" but politely.
  • ns β€” A reference to an array of Zonemaster::Engine::Nameserver objects for the domain, built by taking the list returned from ns_names() and looking up addresses for the names. One element gets added to this list for each unique name/IP pair. Names where no addresses could be found will not be in this list β€” ghosted, honestly. And bestie, this list is lazy-loading, so only look at as many entries as you really need, okay? There are zones with more than 20 nameservers, and looking up all their addresses can take some considerable time. do not do that to yourself πŸ™ˆ
  • glue_names β€” A reference to an array of Zonemaster::Engine::DNSName objects, holding the names of this zone's nameservers as listed at the first responding nameserver of the parent zone. so like, the parent's version of the guest list.
  • glue β€” A reference to an array of Zonemaster::Engine::Nameserver objects for the domain, built by taking the list returned from glue_names() and looking up addresses for the names. One element gets added to this list for each unique name/IP pair. Names for which no addresses could be found will not be in this list. And again β€” lazy-loading! take care to only look at as many entries as you really need, because same problem, same suffering. Special tea: in the case of undelegated tests and fake delegation, the IP associated with nameservers for the tested zone will be the ones set by users (saved in %Zonemaster::Engine::Recursor::fake_addresses_cache), instead of the ones found recursively. so the fakes stay fake on purpose, periodt.
  • glue_addresses β€” A list of Zonemaster::LDNS::RR::A and Zonemaster::LDNS::RR::AAAA records returned in the Additional section of an NS query to the first listed nameserver for the parent domain. bonus content, dropped right in the Additional section like a surprise gift 🎁

πŸ’… METHODS πŸ’…

  • query_one($name[, $type[, $flags]]) β€” Sends (or retrieves from cache) a query for the given name, type and flags, sent to the first nameserver in the zone's ns list. If there's a response, it comes back in a Zonemaster::Engine::Packet object. If the type argument isn't given, it defaults to 'A'. If the flags aren't given, they default to "class" IN plus "dnssec", "usevc" and "recurse" according to configuration β€” and that config is off by default on all three. yes all three. off. bye.
  • query_persistent($name[, $type[, $flags]]) β€” Identical to query_one, EXCEPT instead of returning the packet from the first server that returns one, it returns the first packet that actually contains a resource record matching the requested name and type. she's not accepting just anyone, she's looking for the one that matches πŸ”₯
  • query_auth($name[, $type[, $flags]]) β€” Identical to query_one, except instead of returning the packet from the first server that returns one, it returns the first packet that has the AA flag set. authoritative only, no randoms, no notes πŸ’…
  • query_all($name, $type, $flags) β€” Sends (or retrieves from cache) queries to all the nameservers listed in the zone's ns list, and returns a reference to an array with the responses. The responses can be either Zonemaster::Engine::Packet objects or "undef" values β€” yes, undef is a valid answer, she's allowed to ghost you sometimes 🫠. The arguments are the same as for query_one.
  • is_in_zone($name) β€” Returns true if the given name is in the zone, false if not. And if it could not be determined with a sufficient degree of certainty whether the name is in the zone or not, "undef" is returned. it's giving "idk her" and honestly? valid. vibe check inconclusive bestie πŸ’€

⚠️ real talk: the lazy-loading thing on ns and glue is not a cute personality trait, it's a whole lifestyle. only touch as many entries as you genuinely need, or you're gonna be waiting on address lookups for a zone with more than 20 nameservers and it will take some considerable time. protect your peace πŸ•―οΈ

and that's the whole page, bestie 🧚 we ate, no crumbs. this was Zonemaster::Engine::Zone from perl v5.40.1, dated 2026-03-21 β€” mwah, kiss the footer goodbye πŸ’œβœ¨

πŸ“¦ where this page comes from