A subdomain is a prefix added to your domain that can hold its own content, like blog.example.com.

A subdomain is an extra name you put in front of your domain to create a separate section of your site, or a separate site entirely. In blog.example.com, "blog" is the subdomain and example.com is the domain. You don't need to register or pay for subdomains: once you own a domain, you can create as many as you need.

People use subdomains to keep different parts of an online presence apart. A shop might live at shop.example.com, a help centre at help.example.com and a test copy at staging.example.com, while the main site stays at example.com.

How subdomains work in DNS

Domain names are read from right to left. The TLD (.com) comes first, then your domain (example.com), and anything to the left of that is a subdomain. Technically, even www is a subdomain.

A subdomain exists once it has a DNS record in your domain's zone file. That's usually:

  • An A record pointing it at a server's IP address, or
  • A CNAME pointing it at another hostname, which is common for third-party services

Because each subdomain has its own records, you can point it somewhere completely different from your main site, such as a booking system or an email marketing tool.

How subdomains work on hosting

In a control panel like cPanel, creating a subdomain usually does two things at once: it adds the DNS record and it creates a folder for the subdomain's files. Visitors to the subdomain see whatever is in that folder, so you can install a separate app there, such as a forum or a staging site. Each subdomain also needs to be covered by an SSL certificate, either its own or a wildcard.

Subdomain vs subdirectory vs add-on domain

  • Subdomain: blog.example.com. Search engines may treat it as somewhat separate from the main site.
  • Subdirectory: example.com/blog. Part of the main site.
  • Add-on domain: a completely different domain, like example.net, hosted on the same account.

Google says it can handle both subdomains and subdirectories. Many site owners still prefer a subdirectory for content like a blog, because it keeps everything clearly under one site and is easier to manage. Use a subdomain when the content is genuinely separate, such as an app, a help centre or a site built on a different platform.

Common subdomain problems

  • A new subdomain doesn't load yet because the DNS change hasn't spread; this usually takes minutes to a few hours
  • Browser security warnings because the certificate doesn't cover the subdomain
  • Old, forgotten subdomains still pointing at services you've stopped using, which someone else could take over by claiming that service

Subdomain questions

Do I have to pay for a subdomain?
No. Subdomains come free with the domain you already own, and you can create as many as your DNS provider and hosting plan allow.
Is www a subdomain?
Yes. Technically www is a subdomain of your domain, which is why www.example.com and example.com need separate DNS records or a redirect between them.
Are subdomains bad for SEO?
No. Search engines can rank subdomains well, but they may treat them as more separate from your main site, so subdirectories are often simpler for blogs and articles.
Was this definition helpful?
Share this definition