Setting the hostname: FQDN or short name?

Better Stack Team
Updated on November 23, 2023

When setting the hostname for a server, you have the choice between using the Fully Qualified Domain Name (FQDN) or a short name.

  • Fully Qualified Domain Name (FQDN): This includes both the hostname and the domain name. For example, a FQDN might look like "server1.example.com". It provides the complete hierarchy of the server's position in the DNS (Domain Name System) structure.
  • Short Name: This is just the hostname without the domain part. For instance, "server1" would be a short name.

Both FQDN and short names have their respective advantages and use cases:

  1. FQDN:
    • Helps in better identification and organization in complex network environments.
    • Ensures a unique identity by including the domain name.
    • Vital for network communication and resolution, providing more information and context within a larger network.
  2. Short Name:
    • Easier to remember and type, especially in local network environments.
    • Faster to type, so it's commonly used in internal networks where the full domain isn't necessary for local communications.
    • Works well within smaller, less complex networks.

The choice of whether to use the FQDN or short name often depends on your network setup, organizational preferences, and specific requirements. In many cases, it's common to use FQDNs in larger, more complex networks to ensure unique identification and to maintain better organization and clarity within the domain hierarchy. For smaller, local networks, administrators might choose to use shorter, simpler names for convenience.

It's worth noting that using a FQDN provides more flexibility, scalability, and adherence to best practices, especially if there's a possibility of the server interacting with systems outside the local network or if it's being used in a more complex network environment.