Register.Domains Register.Domains
Cart

View Domains

Check Out

Your cart is empty

Contact Us

For email assistance, just contact us

Services

Hostname vs Domain Name vs Subdomain: How They Work Together

Written by Steven White ·

Hostname vs Domain Name vs Subdomain: How They Work Together

🔍 Summary:

TL;DR: A domain name (brand.com) is the registered, human-readable address you own. A hostname is the label that points to a specific machine within a network (like the www in blog.brand.com). You register the domain once, then create hostnames and subdomains under it. The top-level is the part at the end (like .com, .net, or anything similar). The hostname portion of a URL is translated into an IP address through DNS.

1. What Is a Hostname?

A hostname is the human-readable name or label given to a device on a network, so people and systems can find it without memorizing numbers.

Hostnames on a Home Network

For these, every device can have a descriptive hostname, such as “johns-laptop” or “office-printer.” It lets other machines on the same local network reach that device by name instead of its raw IP address. They don’t need to connect to the internet, so two different offices can both have a “ReceptionPC” so long as they never connect to the same local network.

To prevent issues, devices need to have clear and distinct hostnames from one another.

Hostnames on a Public Internet

A hostname here identifies a particular service or a device inside your domain and is commonly represented by labels such as "www," "mail," or "api" that appear before the registered domain name.

For example, www.brand.com points to your web server, while mail.brand.com points to your mail server, even when they’re the same machine.

The hostname labels you’ll see most often are:

  • www for a website
  • mail for email
  • ftp for file transfer
  • api, shop, blog, or app for specific services.
  • m for mobile-focused websites
  • country-codes like “uk” or “us” for country-specific pages for international companies.

Hostname Naming Rules

Hostnames allow letters, digits, and hyphens, but no spaces or most special characters, and a label can’t start or end with a hyphen. Each label maxes out at 63 characters, the full name at 255, and case doesn’t matter. These limits come from the Internet Standard RFC 1123.

2. What Is a Domain Name?

A domain name is the registered address that represents your presence on the internet, like brand.com. While a hostname can be just a local device label, a domain name lives in the global Domain Name System (DNS) and has to be unique worldwide. MDN’s domain glossary is a handy reference if you want the formal definition.

The domain hierarchy goes in reverse order of how you read the domain name. In the example, “.com” is the top-level domain or TLD (and large companies can even buy a personalized TLD to make the branding fit), and “brand” is the second-level domain or SLD for the brand name you chose when registering. Anything added in front of that, like www or blog, is either a host or subdomain label.

Because domain names must be unique, they’re handed out through registrars and tracked in central registries, so you register a domain name like brand.com to reserve exclusive use of it. Hostnames and subdomains under it, though, are yours to create freely once you own the domain.

3. What Makes a Good Domain Name?

A strong domain is short, easy to say and spell, memorable, and matched to a fitting TLD, while avoiding hyphens and confusing numbers. The right type of domain, however, depends on your goals, and the name you pick here becomes the root of everything else that is built on.

4. Hostname vs Domain Name: Side-by-Side Comparison

Here’s the difference between hostname and domain name at a glance before we go deeper into the pieces.

Aspect Hostname Domain Name
Definition Human-readable label for a specific device or server on a network Registered, globally unique address in the DNS hierarchy
Example www, mail, or blog.brand.com brand.com
Identifies One machine or service Your whole domain and brand presence
Registration Created within your domain via DNS; not registered separately Must be registered through a registrar
Uniqueness Unique within its own domain or network Unique across the entire internet
Changing it Add or edit anytime in DNS Acquired by registration and kept via renewal

5. Root Domain vs Subdomain

The difference between root domain and subdomain trips up a lot of people, but it’s simple once you see it on one address.

Root Domain and Example

So what is a root domain? It’s the registered domain with no prefix in front: brand.com.

It’s also sometimes called the apex or naked domain. When registering, you apply only for the root domain, and hosts and subdomains essentially get included since the root domain satisfies the “uniqueness” clause.

Root Domain as Host

The root domain can sometimes double as a hostname. When brand.com (with no prefix) is put into the URL bar, the DNS can translate it as if you put www.brand.com. However, this requires that the domain owner has configured redirects or DNS records accordingly.

Subdomain and Example

So what is a subdomain in a URL? That’s the leading section before your root domain, for example blog.brand.com.

You can create subdomains for free in DNS and point them to wherever you like, often to different content or a different server.

You should use subdomains when the content on them refers to one another or a specific brand (serving the same territory). For example, shop.brand.com and blog.brand.com are the sales- and information-oriented parts of brand.com, but they’ll be useful to the same audience. If you want to branch out into a different market altogether, you’re better off using a different top-level domain instead (so brand2.com).

Is www a Hostname or a Subdomain? This is one of the more confusing parts of the DNS structure, since it’s technically both. While the root domain is just brand.com, putting www.brand.com essentially makes “www” a subdomain for it. However, the functional part is that this simply points to the device or server that hosts the website that also holds the root domain.

6. What Is a Fully Qualified Domain Name?

A fully qualified domain name (FQDN) is the complete, unambiguous address of a specific hostname: hostname, domain, and TLD together, such as www.brand.com. It points to exactly one place in the DNS tables.

In a more concrete example, mail.brand.com (like mail.google.com), the “mail” part is the hostname, which refers to the specific mail service that Google uses. For “regular” domain names like blog.brand.com, the “blog” part is the subdomain. Then, “brand” is the SLD, while “com” is the TLD. The implied root name is “brand.com” (SLD and TLD put together).

While browsers will resolve a website name off the root domain alone, the exact FQDN is required for email routing, server configuration, and SSL/TLS certificates. Your mail records point to a hostname like mail.google.com, and a certificate is issued to a precise name such as www.brand.com.

7. Hostname vs Domain Name vs URL vs IP Address

These four terms describe different layers of the same request.

Aspect Hostname Domain name URL IP address
What it is A label naming a specific device or service on a network A registered, human-friendly name for a presence on the internet The full address that locates a resource and says how to reach it The numeric address that actually identifies a device on a network
Example www, mail, server01 brand.com https://www.brand.com/collection 192.168.0.1 (IPv4), 2606:2800:220:1::1 (IPv6)
What it identifies One machine or service A namespace owned by an organization A single resource (page, file, endpoint) A device or network interface
Readable by Humans Humans Humans Machines (numeric)
How it relates to the others Sits in front of a domain to form a fully qualified domain name The part you register, hostnames go before it, URLs wrap around it Contains a hostname and domain, plus scheme, path, and query What a hostname or domain ultimately resolves to
Uniqueness Unique within its domain or local network Globally unique (via a registrar) Points to one specific resource Public IPs are globally unique
Managed / resolved by DNS or local resolution depending on network type Registrars and registries; resolved via DNS Parsed by the browser; host portion resolved via DNS Assigned by ISPs/IANA; names mapped to it by DNS

In short: you type a URL, which contains a hostname and a domain name. Then, DNS translates that name into an IP address, which is what your device actually connects to.

8. How DNS Connects Hostnames and Domain Names

The Domain Name System (DNS) is the Internet’s address book, changing the names you type into the IP addresses devices actually use for communication. While the actual structure of the DNS is fairly complex, it uses three basic types of records for most communication.

A Records

An A record maps a hostname or domain straight to an IPv4 address, so brand.com points to a numeric server address (its sibling, the AAAA record, does the same for IPv6).

CNAME Records

A CNAME record makes one hostname an alias of another, which is how www.brand.com is commonly pointed to a hosting provider’s address, so they always end up in the same place. Notably, this part is also how www.brand.com and brand.com resolve, but this is done by providers creating alternative CNAME records since the root can’t technically be aliased to (this is a long-debated aspect of the DNS system that is beyond the scope of this blog).

MX Records

MX (mail exchange) records tell the internet where to deliver email for your domain, pointing to mail-server hostnames in priority order so messages reach the right place.

9. Common Hostname and Domain Name Mistakes

In most cases, when you set up your website, the stock options should make it run well and require practically no modifications. But once you go deeper into server setup, you might encounter one of the following issues.

Mixing Up Root Domains and Subdomains

While the root domain will usually link to subdomains (and vice versa), they’re different parts of the system and crawled separately for SEO and analytics. It’s best to come up with a content hierarchy that delineates what goes on the root and what goes into subdomains.

Confusing www With the Domain Itself

The www.brand.com and brand.com addresses are not automatically the same address. Technically, each needs its own DNS setup. This can be done by setting up redirects between one and the other (rather than CNAME records). Cloudflare has added this to their basic redirecting guidelines, and other hosting providers follow similar rules.

10. Picking the Right Domain Name for Your Project

Once the parts make sense, the one decision that really matters is the root domain you register, because hostnames, subdomains, and FQDNs all build on it. You can go through the entire process on Register.Domains, starting with a domain search to check if your intended name is taken.

If it is, you can use a WHOIS lookup to locate the actual owner of the domain, then contact them directly if possible. Alternatively, you can try another name or use a different TLD.

But sometimes, picking the name is the hard part. Try the Register.Domains AI Domain Name Generator to find available ideas across 1,000+ extensions.

Get Started With Register.Domains

Start with a domain search on Register.Domains to check if your intended name is taken, or use the AI Domain Name Generator to find available ideas across 1,000+ extensions.

Start Your Domain Search Today

11. Frequently Asked Questions

Do I need to register a hostname like a domain name?

You register the domain (brand.com), and that’s the only part. Hostnames and subdomains like www.brand.com or blog.brand.com are created inside your domain through DNS setup.

Can I point a subdomain and a root domain to different servers?

Yes, since they are treated as separate addresses by the DNS resolver. That’s exactly how brands run their main site and, say, a separately hosted blog or store.

How do I find the hostname of a website?

The hostname is the part between the scheme and the first slash, like www.brand.com in https://www.brand.com/page. For the domain’s underlying details, a WHOIS lookup will show the owner of the domain, unless they use WHOIS privacy (which uses the registrar’s redacted data instead).

What are the four types of DNS servers?

People usually mean the four kinds of DNS server that cooperate on every lookup: the recursive resolver that takes your request, the root server it asks first, the TLD server for the extension (like .com), and the authoritative nameserver that holds the actual record for the domain.

More Articles

The extension that fits your industry, and which have rules
The extension that fits your industry, and which have rules

There is no single best domain extension - there is a best one for what you do. This guide matches ten types of business to the extensions that fit them, flags the ones that verify credentials before letting you register, and answers the three questions that decide the choice in practice.

Local presence rules for country domains, country by country
Local presence rules for country domains, country by country

Around 80 country domain extensions ask for a local address, contact or company. This guide lists them one by one, says who can register each directly, and shows the two legal routes for everyone else: a trustee service or a locally registered trademark.

More Articles