Linux: find out information about current domain name and host name

Linux: find out information about current domain name and host name

To find out information about the current domain name and host name on a Linux system, you can use the hostname command. This command displays the current hostname of the system.

To display the fully qualified domain name (FQDN) of the system, you can use the -f flag. For example:

hostname -f
Source:w‮tual.ww‬turi.com

This will output the FQDN, which includes both the hostname and the domain name.

Alternatively, you can use the domainname command to display the current domain name. This command does not display the hostname, only the domain name.

domainname

You can also use the dnsdomainname command to display the domain name as it is configured in the system's Domain Name Service (DNS) settings.

dnsdomainname
Created Time:2017-10-30 10:17:48  Author:lautturi