The FQDN is the abbreviation for fully qualified domain name, meaning the full domain name. For example, a machine host name (hostname) is www, and domain suffix (field) is example.com, the FQDN of the host should be www.example.com. In addition, the FQDN is finally "." To the end, but most applications and servers allow this last point to be ignored.
Linux allows users to view and set host names through the hostname command. The user can also get the FQDN of the host through the Hostname-f command. However, there is no command to set the FQDN directly. The following is a brief introduction to the Setup method.
First set the host name in the/etc/hostname file:
[root@localhost~]# Vi/etc/hostname
Elk
Then add a row of host records in the/etc/hosts file, the first field is the IP address of the host, the second field is the FQDN you want to set, and finally the host name you just set:
[root@localhost~]# vi/etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4localhost4.localdomain4
:: 1 localhost localhost.localdomainlocalhost6 localhost6.localdomain6
192.168.3.95elk.server.com Elk
Update the host name by Hostname-f/etc/hostname. To see the FQDN through Hostname-f:
[root@localhosttls]# hostname-f/etc/hostname
[root@localhosttls]# hostname-f
Elk.server.com
[root@localhosttls]# hostname
Elk