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 for hostfqdn(). 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 :all shortcut, 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::Hostname by David Sundstrom <sunds@asictest.sc.ti.com> β€” credit where credit is due 🫢
  • Steve Hay <shay@cpan.org> is now maintaining libnet as of version 1.22_02 πŸ‘‘

  • 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