hostname

From RaySoft

hostname is the program that is used to either set or display the current host, domain or node name of the system. These names are used by many of the networking programs to identify the machine.[1]

Documentation

Syntax

hostname [PARAMETER ...] [NAME]

Parameters

-a, --alias
Display the alias name of the host (if used).
-A, --all-fqdns
Displays all FQDNs of the machine. This option enumerates all configured network addresses on all configured network interfaces, and translates them to DNS domain names. Addresses that cannot be translated (i.e. because they do not have an appropriate reverse DNS entry) are skipped.
-d, --domain
Display the name of the DNS domain.
-I, --all-ip-addresses
Display all network addresses of the host. This option enumerates all configured addresses on all network interfaces. The loopback interface and IPv6 link-local addresses are omitted.
-s, --short
Display the short host name. This is the host name cut at the first dot.

Examples

Show the FQDNs
hostname --all-fqdns

Output:

oxygen.raysoft.loc

References

  1. man 1 'hostname'