The Parts of an FQDN
Read an FQDN from right to left, from the most general part to the most specific:
| Part | In server1.example.com. |
|---|---|
| Root | The final dot |
| Top-level domain | com |
| Domain | example |
| Host | server1 |
Each part between dots is a label. A label can be up to 63 characters long and the whole name up to 253 characters in its written form. Host names use letters, digits, and hyphens, and a label cannot start or end with a hyphen. A name such as mail.eu.example.com has more levels; it is still one FQDN.
The Trailing Dot
Strictly, an FQDN ends with a dot, server1.example.com., and the dot stands for the DNS root. Browsers and most tools treat a name with dots as complete without it, so you rarely type it. It matters in two places:
- Zone files: a name without the final dot has the zone name appended, so
server1.example.comin the zone for example.com becomes server1.example.com.example.com. - Resolver search domains: a name without the dot may be tried with the search domains from the resolver configuration first.
The dig command always prints names with the dot.
Hostname vs FQDN
The hostname is the short name of the machine, the first label: server1. The FQDN adds the domain: server1.example.com. Check both:
hostname
hostname -s
hostname -fhostname -s prints the short name and hostname -f the FQDN. To find the full name, hostname -f looks up the machine's hostname through the system resolver, which usually reads /etc/hosts before DNS. If it prints only the short name or an error, neither the hosts file nor DNS has a matching entry.
Set the FQDN on Linux
A common choice is to set the static hostname to the full name:
sudo hostnamectl set-hostname server1.example.comOthers keep the short name there and give the full name only in /etc/hosts. Either works as long as the hosts file line matches. The steps are in how to change the hostname in Ubuntu; hostnamectl works the same way on Debian, AlmaLinux, and Rocky Linux.
The /etc/hosts Line
Put the FQDN first, then the short name:
203.0.113.10 server1.example.com server1On Debian and Ubuntu, the installer often writes this line with the address 127.0.1.1 instead of the public one. That is enough for hostname -f; services that announce the server's name to others are better served by the real address. See how to edit the hosts file.
Why Mail Servers and Panels Ask for One
- Mail servers: a mail server introduces itself by name in the SMTP greeting (HELO or EHLO). Receiving servers expect a real FQDN that resolves, and many compare it with reverse DNS. A bare hostname or "localhost" there is a common reason for rejected mail.
- Control panels: installers ask for an FQDN as the server's hostname and use it for the panel's own certificate and outgoing mail. Use a dedicated name such as server1.example.com, not the bare domain of your website.
- Certificates: a TLS certificate is issued for names, so the name you connect to must match one of them.
Match It with DNS and Reverse DNS
For a server that sends mail, three things should agree:
- An A record, and AAAA for IPv6, points the FQDN to the server's address.
- The reverse DNS (PTR) record for that address returns the same FQDN. You set it in your provider's control panel, not in your own zone.
- The hostname or the mail server's configuration uses that FQDN.
dig +short server1.example.com
dig +short -x 203.0.113.10Both lines should point at each other. PTR records are explained in what is reverse DNS.
Updated:
Linux VPS with Full Root Access
MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.
More Guides
No Limits on Service or Support
You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

- 100% customer satisfaction goal
- Our own hardware
- 24/7 ticket and email support
- 4 countries with locations