How to see and update the Fully Qualified Domain Name (FQDN) on Linux


This article shows you how to manage the Fully Qualified Domain Name (FQDN) in Linux



You can check:

  • the FQDN
hostname -f
# or 
hostname --fqdn
  • or the domain name
# same as
hostname -d


Host file

The recommended method of setting the FQDN is to make the hostname be an alias for the fully qualified name using host file (ie /etc/hosts), DNS, or NIS.

For example, if the hostname was “ursula”, one might have a line in /etc/hosts which reads ursula

DNS resolver

in the search properties of the Linux - The DNS resolver (/etc/resolv.conf) file

Documentation / Reference

Discover More
Linux - Hostname (Kernel, Static)

How to manage the hostname under Linux. FQDN The static hostname is stored in /etc/hostname. Historically this file was supposed to only contain the hostname and not the full canonical FQDN....
Map Of Internet 1973
Network - Fully Qualified Domain Name (FQDN)

FQDN stands for fully qualified domain name. It's a name that is said to be absolute (ie that includes the local domain and ends with a dot). This name identifies uniquely a node in the namespace....

Share this page:
Follow us:
Task Runner