Hostname, Domain Name, and FQDN: Three Different Things
These three terms describe different parts of a network address hierarchy. They are frequently confused because they overlap in casual usage, but each has a precise technical meaning:
- Hostname — the name of a specific device or service
- Domain name — the name of an organization or zone in DNS
- FQDN — the complete, unambiguous address combining hostname + domain
Think of it like a mailing address: the hostname is the person's name, the domain is the street and city, and the FQDN is the complete address needed to deliver a letter anywhere in the world.
What Is a Hostname?
A hostname is the label assigned to a specific device or network service within a local network or domain. It uniquely identifies one machine within its scope.
Examples of hostnames:
www— the web servermail— the mail serverftp— an FTP serverapi— an API serverDESKTOP-AB1234— a Windows computerjohns-macbook— a laptop on a home network
Hostnames must follow DNS label rules: letters, digits, and hyphens only; no underscores (though common in practice); max 63 characters per label; case-insensitive.
On Linux, you can see or set your machine's hostname with:
hostname # View current hostname
hostnamectl set-hostname newname # Set hostname (systemd)On Windows: hostname in Command Prompt, or via System Properties.
What Is a Domain Name?
A domain name identifies an organization or zone in the global DNS hierarchy. Domain names are structured hierarchically, read right to left from most general to most specific:
- Root domain: The invisible dot at the end (e.g.,
.) - Top-level domain (TLD): .com, .org, .net, .uk, .io
- Second-level domain: google, amazon, cloudflare
- Subdomain: www, mail, api, dev
The "domain name" you buy from a registrar (like google.com or yourcompany.io) is technically the second-level domain + TLD. Subdomains (like www.yourcompany.io) are created within your domain by adding DNS records.
What Is an FQDN (Fully Qualified Domain Name)?
An FQDN (Fully Qualified Domain Name) is the complete, absolute DNS name that uniquely identifies a host anywhere on the internet. It includes every label from the hostname all the way to the root:
www.google.com.
│ │ │ └── Root (trailing dot, usually omitted)
│ │ └──── TLD (.com)
│ └──────────── Second-level domain (google)
└──────────────── Hostname / subdomain (www)A true FQDN ends with a trailing dot (e.g., www.google.com.) indicating the DNS root, though most tools and browsers omit it. Without the trailing dot, a name is technically a relative or partially qualified domain name — the DNS resolver may append a search domain before resolving it.
Hostname vs Domain Name: The Key Differences
| Property | Hostname | Domain Name | FQDN |
|---|---|---|---|
| Scope | Single device or service | Entire organization or zone | Global — unique across the whole internet |
| Example | www, mail, api | google.com, yourcompany.io | www.google.com, mail.yourcompany.io |
| Resolves to IP? | Only within local DNS scope | Resolves to the domain's DNS zone | Yes — globally resolvable to an IP via A/AAAA records |
| DNS record | Used as the left part of A/CNAME records | The zone apex (@ record) | The full record name in DNS |
| Who assigns it | Server administrator / DHCP | Domain registrar + DNS zone owner | Combination of both |
Practical Examples
Example 1: Company email server
- Hostname:
mail - Domain:
company.com - FQDN:
mail.company.com - DNS A record:
mail.company.com → 203.0.113.10
Example 2: Internal network device
- Hostname:
printer-floor2 - Domain:
corp.internal - FQDN:
printer-floor2.corp.internal - This resolves only inside the corporate network — not on the public internet.
Example 3: Cloud server
- Hostname:
api - Domain:
myapp.io - FQDN:
api.myapp.io - DNS A record points to the server's public IP; SSL certificate issued for the FQDN.
Hostname vs IP Address
A hostname (or FQDN) is a human-readable name that DNS resolves to an IP address. The IP address is what routers actually use to forward packets — hostnames are never used at the network layer. DNS translates FQDN → IP so humans don't have to remember numeric addresses.
You can verify this with:
nslookup www.google.com # Shows IP for the FQDN
ping www.google.com # Resolves FQDN then pings the IP
host api.yourapp.io # Simple DNS lookupHow DNS Resolution Uses FQDNs
When your browser visits www.google.com, the DNS resolver:
- Appends the trailing dot to get the true FQDN:
www.google.com. - Queries the root nameservers for the
.comTLD. - Queries the .com TLD nameservers for
google.com. - Queries Google's authoritative nameservers for the
wwwA record. - Returns the IP address to your browser, which then opens a TCP connection.