What Is a Hostname?
Infrastructure Editor
Disclosure: Some links on this page are affiliate links — if you sign up through one, we may earn a commission at no extra cost to you. It never changes our ratings, rankings or verdicts: we don't sell hosting and take no pay-for-placement.
Who it's for
- Website owners configuring DNS
- Small business owners setting up subdomains
- Students learning networking terminology
By Marcus Feld, Infrastructure Editor (former data-center systems engineer)
What Is a Hostname? A Plain Definition
A hostname is the specific label assigned to an individual machine or service on a network, used to identify it distinctly from other machines. On the web, hostnames are most often seen as the part of a web address that comes before the main domain. Examples are the “www” in www.example.com, or “mail” in mail.example.com. Combined with the domain, a hostname forms what’s called a fully qualified domain name — a complete, specific address for one particular service.
The Analogy: A Department Within a Company
If a domain name is a company’s name, a hostname is like a department inside that company. “Example Inc.” might have a sales department and a support department, plus a shipping department. Each does a different job, but all operate under the same company name. www.example.com, mail.example.com, and shop.example.com work the same way. They’re three different services, each with its own hostname, all sitting under the same domain, example.com.
How Hostnames Connect to Hosting
Hostnames matter directly to hosting because a single hosting account often serves several distinct services under the same domain. Each one needs its own hostname to be reachable separately. A website’s main pages might live at www.example.com, while a separate mail service answers at mail.example.com, and a customer portal sits at portal.example.com. Each of these hostnames is configured through DNS record types, typically pointing to the same or different IP addresses depending on where each service actually runs. On a VPS hosting plan, a developer might configure several hostnames pointing to services running on the same virtual machine, or to entirely separate machines.
Hostname vs Domain Name
It’s easy to blur hostname and domain name together, but they describe different layers of the same address. The domain name, example.com, is the registered, ownable piece. The hostname is a label added in front of it to identify a specific service within that domain. Unlike the domain itself, hostnames don’t need to be separately registered or renewed. A domain owner can create as many hostnames as needed, pointing each at whatever server or service makes sense.
Related Terms
Nameserver
The server holding the DNS records that define a domain’s hostnames.
DNS record types
The reference for how hostnames are technically configured, including A and CNAME records.
Subdomain
A more casual, commonly used term overlapping heavily with hostname in everyday conversation.
FQDN (fully qualified domain name)
The complete address formed by a hostname plus a domain.
A Concrete Example
A software company runs its main marketing site at www.buildstack.io, hosted on one server. Its customer support ticketing system runs at support.buildstack.io, hosted on an entirely different service from a third-party provider. Both hostnames sit under the same registered domain, buildstack.io, but each is configured with its own DNS record, pointing to a different destination. Visitors typing either address land on the correct service. They never need to know that two completely different systems are answering behind two different hostnames under one shared domain.
Common Misconception
A common misconception is assuming “www” is a required part of every website address, or that it means something functionally different from the bare domain. In most modern configurations, www.example.com and example.com point at the exact same website. “www” is kept mostly for historical convention, not technical necessity. Another frequent mix-up is treating “hostname” and “subdomain” as strictly different concepts. In casual usage among website owners, the two terms are used almost interchangeably, and the same address can accurately be described either way.
FAQ
Do I need to set up a hostname for every website I run? Every domain automatically resolves at a bare level. Adding hostnames like “www” or “shop” requires explicit DNS records, usually configured through a hosting or DNS management panel.
Is a hostname the same as a server’s name? Loosely, yes — the term originally referred to the name assigned to identify a specific machine on a network. In the context of websites, it’s used more broadly to mean any labeled address pointing at a service under a domain.
Can two hostnames point to the same server?
Yes, this is common. Multiple hostnames — like www.example.com and blog.example.com — can point to the same IP address and be handled by the same server. They’re distinguished internally by the exact address requested.
Does changing a hostname require a new domain registration? No. Hostnames are created and changed through DNS records under an existing domain, with no separate registration or renewal process required.