Skip to main content

How to set up a subdomain (and when you should)

A subdomain is a prefix on your domain — blog.example.com, shop.example.com, api.example.com. They are useful for separating services, but they are not always the right choice for content. Here is how to set one up and when to reach for one.

What a subdomain is

In blog.example.com, 'blog' is the subdomain and example.com is the root domain. It is a separate hostname, which means browsers, search engines and TLS certificates treat it as its own entity.

How to add one

  • Decide where it should point — the same server as the main site, or a different one.

  • Add a DNS record for the subdomain (an A record, or a CNAME to another hostname).

  • Configure the web server to serve that hostname (a new vhost or server block).

  • Issue a certificate that covers the subdomain.

text
blog   A      203.0.113.10
api    CNAME  app.internal.example.com

Subdomain or subfolder?

This is the decision that matters most, especially for SEO.

  • Subfolder (example.com/blog) — content contributes to the root domain's authority. Usually best for blogs and marketing content.

  • Subdomain (blog.example.com) — separate identity; useful for apps, staging, or genuinely separate services.

  • Search engines can rank subdomains well, but you start from zero authority on each one.

Certificates for subdomains

Each subdomain needs to be covered by its certificate. You can issue one per subdomain, or use a wildcard certificate (*.example.com) to cover all of them at once. A wildcard covers one level only — it does not cover deep.sub.example.com.

Common mistakes

  • Adding the DNS record but not configuring the web server for the hostname.

  • Forgetting a certificate, so the subdomain shows a warning.

  • Splitting related content across subdomains and losing link equity.

  • Leaving a staging subdomain indexed by search engines.

Our domain and hosting panels make subdomains and their certificates a couple of clicks, and our SSL checker confirms the certificate covers the hostname before you go live.