DNS::LDNS::RData(3)

πŸ’– DNS::LDNS::RData β€” the manual page, but make it cute πŸ’–

okay bestie, welcome to DNS::LDNS::RData(3) from the User Contributed Perl Documentation girlies πŸŽ€ this is the little page that explains RData β€” aka the rdata field, or a dname, inside an rr. yes it's giving "DNS internals" and yes you're gonna slay it. ✨


✨ NAME ✨

DNS::LDNS::RData β€” Rdata field or a dname in an rr πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole vibe, copy-paste ready, no cap:

  use DNS::LDNS ':all'

  my rd = new DNS::LDNS::RData(rdf_type, str)
  rd2 = rd->clone

  rdf_type = rd->type
  rd->set_type(rdf_type)

  rd->print(\*FILE)
  str = rd->to_string

  count = rd->label_count
  rd2 = rd->label(pos)

  bool = rd->is_wildcard
  bool = rd->matches_wildcard(wildcard)
  bool = rd->is_subdomain(parent)

  rd2 = rd->left_chop

  status = rd->cat(rd2)
  rd->compare(rd2)
  rd2 = rd->address_reverse
  rd2 = rd->dname_reverse

  rd2 = rd->nsec3_hash_name(name, algorithm, iterations, salt)

  epoch = rd->to_unix_time
( epoch = rd->2native_time_t )

  rr_type = rd->to_rr_type

so like, what's happening here πŸ‘€

  • You build one with new DNS::LDNS::RData(rdf_type, str) β€” give it a type and a string, boom, you got an object. Or you can rd->clone an existing one if you want a twin. main character duplication energy πŸ‘‘
  • rd->type reads the rdf type, rd->set_type(rdf_type) sets it. read it, write it, obsessed.
  • rd->print(\*FILE) dumps it out to a filehandle, and rd->to_string gives you the string version instead. lowkey both are useful.
  • Labelling era: rd->label_count tells you how many labels there are, rd->label(pos) hands you the one at pos.
  • Wildcard checks bestie!! rd->is_wildcard, rd->matches_wildcard(wildcard), and rd->is_subdomain(parent) β€” all returning bools, all doing exactly what they say 🫢
  • rd->left_chop β€” literally chops from the left. iconic behaviour.
  • The duo: rd->cat(rd2) concatenates and gives you back a status, and rd->compare(rd2) compares. and then rd->address_reverse and rd->dname_reverse flip things around for you πŸ”„
  • NSEC3 moment: rd->nsec3_hash_name(name, algorithm, iterations, salt) β€” give it a name, algorithm, iterations and salt, get back a hashed name. it's giving cryptography, it's giving slay 🧚
  • Time stuff: rd->to_unix_time gives you an epoch, and there's rd->2native_time_t for the same energy.
  • And finally rd->to_rr_type hands you back an rr_type. cute.
fr fr, just follow the signature order and you're golden β€” the args are positional, no named-arg nonsense here.

🌈 SEE ALSO 🌈

go touch grass at the source, bestie:


πŸ’œ AUTHOR πŸ’œ

Erik Pihl Ostlyngen, <erik.ostlyngen@uninett.no> β€” the legend who wrote this. shoutout 🫑


Copyright (C) 2013 by UNINETT Norid AS

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.

so yeah, it's free software, same terms as Perl, version 5.14.2 or any later version you have. you're covered, you're safe, you're thriving πŸ’–

and that's the page, bestie!! this was DNS::LDNS::RData(3) from perl v5.42.2, dated 2026-06-11 β€” tysm for reading, go write some rdata, ily, periodt πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from