Zonema...cursor(3pm)

πŸ“¦ version 1.0.16, in ubuntu jammy

πŸ’– Zonemaster::Recursor πŸ’–

okay bestie so this is the Zonemaster::Recursor page β€” it's a recursive resolver for Zonemaster 🌈 and it lives in the User Contributed Perl Documentation, section 3pm. yes you read that right, someone just casually contributed this absolute icon. 🫢


✨ SYNOPSIS ✨

the vibe check, in code:

my $packet = Zonemaster::Recursor->recurse($name, $type, $class);
my $pname = Zonemaster::Recursor->parent('example.org');

that's it. that's the whole entry point. short, sweet, slay. πŸ’…


πŸ¦‹ METHODS πŸ¦‹

πŸŽ€ recurse($name, $type, $class)

does a recursive resolution from the root servers on down for the given triplet. like, it starts all the way at the top of the DNS tree and walks its way down to find your answer. main character energy fr fr ✨

πŸŽ€ parent($name)

does a recursive resolution from the root down for the given name β€” and heads up, it's using type "SOA" and class "IN" for this one. πŸ’œ

now the plot twist: if the resolution is successful, it hands you back the domain name of the second-to-last step. but if the resolution is unsuccessful, it returns the domain name of the last step. so like, either way you get a name, just… which name depends on whether things went well. noted. πŸ“

πŸŽ€ get_ns_from($packet, $state)

okay so this one is an internal method β€” not for you, bestie, it's for the module's own business. πŸ™ˆ it takes a packet and a recursion state and returns a list of ns objects. it's used to follow redirections. that's the whole job. iconic. πŸ‘‘

πŸŽ€ get_addresses_for($name[, $state])

takes a name and gives you back a (possibly empty) list of IP addresses for that name β€” and they come in the form of Zonemaster::Net::IP objects, so they're fancy. ✨

and when it's used internally by the recursor, it gets passed a recursion state as its second argument. that's what the little [, $state] is doing there. iykyk. 🧚

πŸŽ€ clear_cache()

a class method that empties the cache of responses to recursive queries. spring cleaning but for DNS. 🧹🌸

πŸŽ€ root_servers()

returns a list of ns objects representing the root servers πŸŒˆπŸ‘‘ and here's the tea: the list of root servers is hardcoded into this module. not fetched, not discovered, just vibing in the source code. periodt. πŸ’…


no cap, that's every method on the page. nothing hidden, nothing skipped. 🫢

and that's the whole thing bestie!! this page is from perl v5.32.0, dated 2021-01-06. take care of her, she's been through a lot. πŸ’–πŸŽ€πŸ¦‹βœ¨πŸŒΈπŸ’œ

πŸ“¦ where this page comes from