Zonemaster::Zone(3pm)
β¨ NAME β¨
Zonemaster::Zone β the object that is a DNS zone, bestie. Like, an actual zone, as a lil Perl thing you can poke at. π
It's a User Contributed Perl Documentation page, so it's living in the 3pm section, and we're about to make it make sense. π
πΈ SYNOPSIS πΈ
my $zone = Zonemaster::Zone->new({ name => 'nic.se' });
my $packet = $zone->parent->query_one($zone->name, 'NS');
that's it, that's the whole vibe check. two lines and you're already doing DNS. π
π¦ DESCRIPTION π¦
okay so. objects of this class represent zones in DNS. that's the whole thing. π«Ά
and here's the part that actually matters: as far as possible, test implementations should access information about zones via these objects. like, don't go around them, go through them. because when you do, you get all of this:
- lazy-loading of the information (the good stuff shows up only when you need it β¨)
- well-defined methods in which the information is fetched
- logging
- the ability to do things like testing zones that have not yet been delegated π
yeah. undelogated zones. main character energy.
π ATTRIBUTES π
nameβ a Zonemaster::DNSName object representing the name of the zone. literally just the zone's name, but fancy.parentβ a Zonemaster::Zone object for this domain's parent domain. and here's the special case you NEED to know: the root zone is considered to be its own parent. so if you're recursing up the tree, look for that. π it's giving ouroboros, ngl.ns_namesβ a reference to an array of Zonemaster::DNSName objects, holding the names of the nameservers for the domain, as returned by the first responding nameserver in the glue list.nsβ a reference to an array of Zonemaster::Nameserver objects for the domain, built by taking the list returned fromns_names()and looking up addresses for the names. one element will be 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 bestie, this list is lazy-loading, so take care to only look at as many entries as you really need. there are zones with more than 20 nameserver, and looking up the addresses of them all can take som considerable time. β³ like, genuinely. pace yourself.glue_namesβ a reference to a an array of Zonemaster::DNSName objects, holding the names of this zones nameservers as listed at the first responding nameserver of the parent zone. (yes, "a an". we don't fix it, we respect it. π)glueβ a reference to an array of Zonemaster::Nameserver objects for the domain, built by taking the list returned fromglue_names()and looking up addresses for the names. one element will be 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 once again: this list is lazy-loading, so take care to only look at as many entries as you really need. πglue_addressesβ a list of Net::LDNS::RR::A and Net::LDNS::RR::AAAA records returned in the Additional section of an NS query to the first listed nameserver for the parent domain. π
π 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 is a response, it will be returned in a Zonemaster::Packet object. π¦
defaults, bestie, write these down:
- if the type arguments is not given, it defaults to
'A'. - if the flags are not given, they default to
"class"IN and"dnssec","usevc"and"recurse"according to configuration (which is by default off on all three). β¨
πΈ query_persistent($name[, $type[, $flags]])
Identical to query_one, except that 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. π picky in the best way.
π
query_auth($name[, $type[, $flags]])
Identical to query_one, except that 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, periodt. π
β 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::Packet objects or undef values. π the arguments are the same as for query_one.
note the shape here:query_alltakes all three arguments β no optional brackets on this one.$name,$type,$flags. all of them. no cap. π
π§ 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 if the name is in the zone or not, undef is returned. π so like, three possible outcomes. handle them all, bestie.
and that's the whole page, bestie! π
this was written by the user-contributed Perl documentation crew, generated with perl v5.32.0, dated 2021-01-06, and it lives in Zonemaster::Zone(3pm). now go query something iconic. π β¨π¦
π¦ where this page comes from
- ubuntu jammy: libzonemaster-perl 1.0.16-2.1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms