Net::Domain(3pm) Perl Programmers Reference Guide Net::Domain(3pm)

# [NAME](#NAME)

Net::Domain - Attempt to evaluate the current host's internet name and domain

# [SYNOPSIS](#SYNOPSIS)

```
    use Net::Domain qw(hostname hostfqdn hostdomain domainname);
```

# [DESCRIPTION](#DESCRIPTION)

Using various methods **attempt** to find the Fully Qualified Domain Name (FQDN) of the current host. From this determine the host-name and the host-domain.

Each of the functions will return *undef* if the FQDN cannot be determined.

## [Functions](#Functions)

[hostfqdn()](#hostfqdn%28%29)

Identify and return the FQDN of the current host.

[domainname()](#domainname%28%29)

An alias for **hostfqdn()**.

[hostname()](#hostname%28%29)

Returns the smallest part of the FQDN which can be used to identify the host.

[hostdomain()](#hostdomain%28%29)

Returns the remainder of the FQDN after the *hostname* has been removed.

# [EXPORTS](#EXPORTS)

The following symbols are, or can be, exported by this module:

[Default Exports](#Default)

*None*.

[Optional Exports](#Optional)

"hostname", "hostdomain", "hostfqdn", "domainname".

[Export Tags](#Export)

*None*.

# [KNOWN BUGS](#KNOWN_BUGS)

See &lt;https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=libnet&gt;.

# [AUTHOR](#AUTHOR)

Graham Barr &lt;gbarr@pobox.com &lt;mailto:gbarr@pobox.com&gt;&gt;.

Adapted from Sys::Hostname by David Sundstrom &lt;sunds@asictest.sc.ti.com &lt;mailto:sunds@asictest.sc.ti.com&gt;&gt;.

Steve Hay &lt;shay@cpan.org &lt;mailto:shay@cpan.org&gt;&gt; is now maintaining libnet as of version 1.22\_02.

# [COPYRIGHT](#COPYRIGHT)

Copyright (C) 1995-1998 Graham Barr. All rights reserved.

Copyright (C) 2013-2014, 2020 Steve Hay. All rights reserved.

# [LICENCE](#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.

# [VERSION](#VERSION)

Version 3.15

# [DATE](#DATE)

20 March 2023

# [HISTORY](#HISTORY)

See the *Changes* file.

2026-10-26 perl v5.44.0

---

Document: Net::Domain(3pm) from perl 5.44.0-r3 (Chainguard OS)
Source: https://github.com/Perl/perl5.git
