Zonema...thodsV2(3pm)

πŸ“¦
version 8.001.001 Β· 4 versions
, in ubuntu stonking

πŸ’– NAME πŸ’–

Zonemaster::Engine::TestMethodsV2 β€” bestie, this is Version 2 of Methods common to Test Specifications used in Test modules. It's the toolbox the Zonemaster test modules keep dipping into, and we're gonna go through every single drawer together. 🫢


✨ SYNOPSIS ✨

my @results = Zonemaster::Engine::TestMethodsV2->get_parent_ns_ips($zone);

That's the vibe β€” one class, a bunch of methods, all of them your new besties. πŸ‘‘


πŸŽ€ METHODS πŸŽ€

okay so here's the thing: if you want the real deep lore on what each of these Methods actually implements, the Test Specifications document is right here and it's iconic:

https://github.com/zonemaster/zonemaster/blob/master/docs/public/specifications/tests/MethodsV2.md

Now let's meet the cast. 🌈

🌸 get_parent_ns_names_and_ips($zone) 🌸

[External] β€” yep, this one's for public consumption, it's giving main character energy.

This Method goes and gets the name server names and IP addresses that serve the parent zone β€” as in, the zone that the Child Zone got delegated from. That whole parent-child delegation situation. πŸ’…

Takes a Zonemaster::Engine::Zone object.

Returns an empty arrayref if $zone is the root zone, or if an undelegated test is in progress. Otherwise it hands you back an arrayref of Zonemaster::Engine::Nameserver objects. And if no parent zone was found at all? You get undef. Sending you thoughts and prayers on that one. 😭

Heads up bestie: the result of this Method is cached for performance reasons. If you need to nuke that cache, call clear_cache() and it's gone. poof. ✨

πŸ¦‹ get_parent_ns_ips($zone) πŸ¦‹

[External]

This Method obtains the name servers that serve the parent zone β€” again, the zone the Child Zone is delegated from. Here's the lil twist though: if more than one name server shares the same IP address, only one among them is kept. We're de-duping. We're being efficient. We're slaying. πŸ’…

Takes a Zonemaster::Engine::Zone object.

Returns an empty arrayref if $zone is the root zone or if an undelegated test is in progress. Otherwise, an arrayref of Zonemaster::Engine::Nameserver objects, or undef if no parent zone was found.

🧚 _get_oob_ips($zone, $ns_names_ref) 🧚

[Internal] β€” backstage pass only, this one's not for the public, iykyk.

This Method obtains the IP addresses of the Out-Of-Bailiwick name servers for the given zone and a given set of name server names.

Takes a Zonemaster::Engine::Zone object and an arrayref of Zonemaster::Engine::Nameserver objects.

Returns an arrayref of Zonemaster::Engine::Nameserver objects for each name server name that was successfully resolved to an IP address, plus Zonemaster::Engine::DNSName objects for each name server name that could not be resolved to an IP address. The unresolved ones still get a seat at the table, they just get a different outfit. πŸŽ€

πŸ’œ _get_delegation($zone) πŸ’œ

[Internal]

This Method obtains the name server names (from the NS records) and the IP addresses (from Glue records) from the delegation of the given zone from the parent zone. And ngl, Glue Records are address records for In-Bailiwick name server names β€” if any. fr fr.

Takes a Zonemaster::Engine::Zone object.

Returns an arrayref of Zonemaster::Engine::Nameserver objects, or undef if no parent zone was found. πŸ’€

✨ get_del_ns_names_and_ips($zone) ✨

[External]

This Method obtains the name server names (from the NS records) and the IP addresses (from Glue Records) from the delegation of the given zone from the parent zone. Glue Records, if any, are address records for name server names. It also obtains the IP addresses for the Out-Of-Bailiwick name server names, if any.

Lowkey important: if the Glue Records include address records for Out-Of-Bailiwick name servers, they will be included twice β€” unless they're identical. Not me double-booking the same IP... πŸ™ˆ

Takes a Zonemaster::Engine::Zone object.

Returns an arrayref of Zonemaster::Engine::Nameserver objects for each name server name that was successfully resolved to an IP address, and Zonemaster::Engine::DNSName objects for each name server name that could not be resolved to an IP address β€” or undef if no parent zone was found.

πŸ“ get_del_ns_names($zone) πŸ“

[External]

This Method obtains the name server names of the given zone as defined in the delegation from the parent zone.

Takes a Zonemaster::Engine::Zone object.

Returns an arrayref of strings, or undef if no parent zone was found.

🌈 get_del_ns_ips($zone) 🌈

[External]

This Method obtains the IP addresses (from Glue Records) from the delegation of the given zone from the parent zone. Glue Records are address records for In-Bailiwick name server names, if any. It also obtains the IP addresses for the Out-Of-Bailiwick name server names, if any.

Takes a Zonemaster::Engine::Zone object.

Returns an arrayref of strings, or undef if no parent zone was found.

πŸ‘‘ get_zone_ns_names($zone) πŸ‘‘

[External]

This Method obtains the names of the authoritative name servers for the given zone, as defined in the NS records in the zone itself.

Takes a Zonemaster::Engine::Zone object.

Returns an arrayref of strings, or undef if no parent zone was found.

🌸 _get_ib_addr_in_zone($zone) 🌸

[Internal]

This Method obtains the address records matching the In-Bailiwick name server names from the given zone.

Takes a Zonemaster::Engine::Zone object.

Returns an arrayref of Zonemaster::Engine::Nameserver objects, or undef if no parent zone was found.

πŸ’– get_zone_ns_names_and_ips($zone) πŸ’–

[External]

This Method obtains the name server names (extracted from the NS records) from the apex of the given zone. Then, for the In-Bailiwick name server names it obtains the IP addresses from the given zone. And for the Out-Of-Bailiwick name server names, it obtains the IP addresses from recursive lookup. Two different routes, one glorious destination. πŸ’…

Takes a Zonemaster::Engine::Zone object.

Returns an arrayref of Zonemaster::Engine::Nameserver objects for each name server name that was successfully resolved to an IP address, and Zonemaster::Engine::DNSName objects for each name server name that could not be resolved to an IP address β€” or undef if no parent zone was found. 😭

πŸ¦‹ get_zone_ns_ips($zone) πŸ¦‹

[External]

This Method obtains the IP addresses of the name servers, as extracted from the NS records of the apex of the given zone.

Takes a Zonemaster::Engine::Zone object.

Returns an arrayref of strings, or undef if no parent zone was found.

✨ clear_cache() ✨

Clears previously cached results of the get_parent_ns_names_and_ips() method.

That's it. That's the whole method. Short, sweet, and honestly iconic for it. πŸŽ€


okay that's the whole page, bestie, you made it to the end and I'm so proud of you 🫢 this was perl v5.40.1, dated 2026-03-21 β€” no cap, go run some lookups and slay. πŸ‘‘πŸ’–

πŸ“¦ where this page comes from