HTTP & Networking

What is a subdomain?

A prefix added to a parent domain to identify a separate section, app, or service, like `blog.example.com` or `api.example.com`.

Subdomains let you carve a domain into named sections without registering separate domains. app.example.com, api.example.com, and docs.example.com can all be configured to point to different servers, run different stacks, and have independent SSL certificates, while sharing a single registered domain.

DNS-wise, a subdomain is just an A or CNAME record under the parent zone. There's no limit on how many subdomains you can create, and you can nest them (v2.api.example.com). Each level becomes a separate origin from the browser's perspective, with implications for cookies, CORS, and storage.

For SEO, subdomains historically were treated as separate sites by Google. That's softened over the years (modern Google generally treats them as part of the same brand) but you still see consultants debate whether blog.example.com or example.com/blog is better for rankings. The honest answer is that either works; pick the one that's easier to operate.

In the wild

  • api.stripe.com, the API host
  • docs.github.com, documentation
  • maps.google.com, a separate product on the same parent brand

How Brand.dev uses subdomain

Endpoints in the Brand.dev API where this concept comes up directly.

FAQ

Subdomain vs subdirectory for SEO?

Modern Google treats them similarly. Subdirectories slightly consolidate authority on the root domain; subdomains let you operate the section as a separate stack. Pick on operational grounds.

Do subdomains share cookies with the parent?

Only if the cookie is explicitly set with Domain=.example.com. Otherwise cookies are scoped to the exact host that set them.

Are wildcard subdomains real?

Yes, a *.example.com DNS record routes any unconfigured subdomain to the same target. Common for SaaS apps that give each customer a tenant subdomain.

Related terms

Ship an agent that actually knows things.

Free tier, 10-minute integration, and the same API powering agents at Mintlify, daily.dev, and Propane. No credit card to start.