Net::Domain(3perl)
π Net::Domain β the manual, but make it cute π
okay bestie, gather round, because we're about to find out what this machine thinks its own name is πΈ (the module is Net::Domain, and the whole vibe is "attempt to evaluate the current host's internet name and domain" β¨)
β¨ SYNOPSIS β¨
use Net::Domain qw(hostname hostfqdn hostdomain domainname);
that's it. that's the whole entry point. slay. π
π¦ DESCRIPTION π¦
so here's the tea: this module uses various methods to try and find the Fully Qualified Domain Name β the FQDN β of the host you're currently sitting on. then, once it has that, it works backwards to figure out the host-name and the host-domain from it. girl math but for DNS π§
and the big caveat, no cap: every single one of these functions will return undef if the FQDN cannot be determined. like, not an error, not a croak, just undef. so pls pls pls check your return values, bestie π
π Functions
hostfqdn()β goes and identifies the FQDN of the current host, then hands it right back to you. that's the main character right there πdomainname()β literally just an alias forhostfqdn(). same girl, different name πhostname()β returns the <b>smallest part</b> of the FQDN that you can still use to identify the host. like the nickname version of the FQDN.hostdomain()β returns whatever's left of the FQDN once you've scooped the hostname out of it. the remainder, the leftovers, the rest of the sandwich π
π«Ά EXPORTS π«Ά
these are the symbols this module gives you (or can give you):
Default Exports
- None. nothing comes for free. not one thing. the default is silence π
Optional Exports
you can ask for these by name:
"hostname""hostdomain""hostfqdn""domainname"
Export Tags
- None. no cute
:allshortcut, sorry babe. you name them, you claim them.
π KNOWN BUGS π
the bug tracker lives here:
<https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=libnet>
go look if something's giving messy energy. π
π AUTHOR π
- Graham Barr
<gbarr@pobox.com>β the original icon π - Adapted from
Sys::Hostnameby David Sundstrom<sunds@asictest.sc.ti.com>β credit where credit is due π«Ά - Steve Hay
<shay@cpan.org>is now maintaining libnet as of version1.22_02π
πΈ COPYRIGHT πΈ
- Copyright (C) 1995-1998 Graham Barr. All rights reserved.
- Copyright (C) 2013-2014, 2020 Steve Hay. All rights reserved.
β LICENCE β
this module is free software β you can redistribute it and/or modify it under the same terms as Perl itself, i.e. under the terms of either the GNU General Public License or the Artistic License, as specified in the LICENCE file. so yes, go off, legally π
π₯ VERSION π₯
Version 3.15
π DATE π
20 March 2023
π§ HISTORY π§
See the Changes file.
and that's the whole page, bestie, we ate and left no crumbs πβ¨ this was Net::Domain, the perl manual page at version 5.44.0, dated 2026-10-17 β mwah, take care of your FQDNs out there πππ¦
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms