yum install net-tools

yum不能用时,就下载rpm来安装

hostname

-f, --fqdn, --long
              Display the FQDN (Fully Qualified Domain Name). A FQDN  consists
              of  a  short  host  name and the DNS domain name. Unless you are
              using bind or NIS for host lookups you can change the  FQDN  and
              the  DNS  domain  name  (which  is  part  of  the  FQDN)  in the
              /etc/hosts file. See the warnings in section THE FQDN above, and
              avoid using this option; use hostname --all-fqdns instead.