Net::Domain(3pm)
π Net::Domain π
okay bestie, so this is the Perl Programmers Reference Guide page for Net::Domain (that's Net::Domain(3pm) if you're being fancy at a terminal), and it's basically the module that tries really hard to figure out what your host is called on the internet. we're talking internet name and domain. it's giving "who am I, really" but for computers β¨
πΈ NAME πΈ
Net::Domain β Attempt to evaluate the current host's internet name and domain
like, it attempts. no promises, but it tries π
π¦ SYNOPSIS π¦
use Net::Domain qw(hostname hostfqdn hostdomain domainname);
that's the whole vibe. import what you need, go off π
π DESCRIPTION π
so here's the deal: this module uses various methods to attempt to find the Fully Qualified Domain Name (FQDN) of the current host. then from that FQDN it works backwards to figure out the host-name and the host-domain. detective energy π
important bestie: each of the functions will returnundefif the FQDN cannot be determined. like, it just gives up and hands you nothing. no error, no drama, justundef. so please check your return values, i am literally begging π
β¨ Functions β¨
hostfqdn()β identifies and returns the FQDN of the current host. this is the main character of the module ngl πdomainname()β an alias forhostfqdn(). same thing, different name, we love a rebrand πhostname()β returns the smallest part of the FQDN which can be used to identify the host. just the little guy π₯Ίhostdomain()β returns the remainder of the FQDN after the hostname has been removed. the leftovers, but make it useful π
π EXPORTS π
the following symbols are, or can be, exported by this module:
π Default Exports
None. nothing. zero. nada. you get nothing for free, bestie π you have to ask for it.
π«Ά Optional Exports
"hostname", "hostdomain", "hostfqdn", "domainname".
all four of the functions, available if you import them β¨
π§ Export Tags
None. no cute little :all shortcuts here, sorry π
π KNOWN BUGS π
see <https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=libnet>.
like, go look at the actual ticket queue, that's where the lore lives π₯
π AUTHOR π
Graham Barr <gbarr@pobox.com <mailto:gbarr@pobox.com>>.
adapted from Sys::Hostname by David Sundstrom <sunds@asictest.sc.ti.com <mailto:sunds@asictest.sc.ti.com>>.
Steve Hay <shay@cpan.org <mailto:shay@cpan.org>> is now maintaining libnet as of version 1.22_02. handing over the aux cord, iconic behavior π§
πΈ 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.
tl;dr: it's free, go wild, just respect the terms fr fr π
π¦ VERSION π¦
Version 3.15
π DATE π
20 March 2023
π HISTORY π
see the Changes file. the whole backstory is in there, iykyk π
aaaand that's the page, bestie!! π written by the Perl Programmers Reference Guide, from perl v5.42.3, dated 2026-11-03 β mwah, slay, go resolve some hostnames responsibly β¨ππ«Ά
π¦ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms