Net::DNS::RR::SRV(3)

πŸ’… Net::DNS::RR::SRV

okay so bestie, you found the Net::DNS::RR::SRV page (that's section 3 of the manual, for the record) β€” and honestly? iconic. this is the class for DNS Service (SRV) resource records, and it's gonna be your new favorite thing. no cap. πŸŽ€


✨ SYNOPSIS ✨

like, the bare minimum to get going:

use Net::DNS;
$rr = Net::DNS::RR->new('name SRV priority weight port target');

that's it. that's the whole vibe check. πŸ¦‹


🌸 DESCRIPTION 🌸

this right here is the class for DNS Service (SRV) resource records. it's giving "specialist" energy and we stan. πŸ’–


πŸ‘‘ METHODS πŸ‘‘

okay, so the actual methods you get are the ones you inherit from the base class, plus the type-specific glow-up methods defined in this very package. best of both worlds, fr fr.

⚠️ real talk: using undocumented package features or reaching directly into internal data structures is discouraged β€” it could literally end your program or cause other unpredictable behaviour. don't do it, bestie. that's not the main character move. πŸ’€

πŸ“ priority

$priority = $rr->priority;
$rr->priority( $priority );

returns the priority for this target host. you can also set it. slay. ✨


⭐ weight

$weight = $rr->weight;
$rr->weight( $weight );

returns the weight for this target host. getter and setter, because we're flexible like that. 🧚


πŸ¦‹ port

$port = $rr->port;
$rr->port( $port );

returns the port number for the service on this target host. yes, the port. the one that matters. πŸ”₯


🌈 target

$target = $rr->target;
$rr->target( $target );

returns the domain name of the target host. that's the whole thing. πŸ’œ


πŸŽ€ Sorting of SRV Records πŸŽ€

so here's the tea: by default, rrsort() hands you back the SRV records sorted from lowest to highest priority, and for records with equal priorities, from highest to lowest weight. neat, orderly, aesthetic. 🌸

πŸ’€ Note: this is NOT the order in which connections should be attempted. like, do not. i'm begging. this is a sort order, not a connection strategy. iykyk. πŸ™ˆ

copyright (c)1997 Michael Fuhr.

portions copyright (c)2005 Olaf Kolkman, NLnet Labs.

all rights reserved.

package template (c)2009,2012 O.M.Kolkman and R.W.Franks.


🫢 LICENSE 🫢

permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted β€” provided that the original copyright notices appear in all copies, that both this copyright notice and this permission notice appear in supporting documentation, and that the name of the author is not used in advertising or publicity pertaining to distribution of the software without specific prior written permission. (yes, that's a long sentence, but it's legally load-bearing. handle with care. ⭐)

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

like, all caps means business. respect it. 😭


🌟 SEE ALSO 🌟

go read them, bestie. you'll be smarter in like ten minutes. πŸ‘‘


and that's the page! πŸŽ‰ this little beauty is from perl v5.42.0, dated 2026-09-02, and it lives at Net::DNS::RR::SRV(3) in the manual β€” go forth and resolve some services, you absolute icon. πŸ’…πŸŒˆ

πŸ“¦ where this page comes from