Back to Blog
DNS

What is a Subdomain and Why Should You Use One?

Subdomains are one of the most useful tools in a developer's toolkit. Here's everything you need to know, in plain English.

April 2026
By Open Domains Team· 5 min read
subdomain dns beginners

If you've spent any time on the web, you've used subdomains without even realising it. mail.google.com, docs.github.com, app.notion.so — these are all subdomains. Understanding how they work and when to use them is one of the most practical DNS skills you can develop.

So, What Actually Is a Subdomain?

A subdomain is an extension that goes in front of your main domain name, separated by a dot. If your domain is example.com, then anything.example.com is a subdomain — where "anything" is the subdomain label.

From a DNS perspective, a subdomain is simply a hostname at a lower level in the DNS hierarchy. You create it by adding a DNS record (usually an A or CNAME record) with the subdomain name in the Name/Host field.

Common subdomain examples
www.example.com       → Traditional website prefix
blog.example.com      → Blog or content section  
app.example.com       → Web application
api.example.com       → API endpoint
staging.example.com   → Pre-production environment
docs.example.com      → Documentation

Why Use Subdomains?

Subdomains let you organise your web presence in ways that are both technically useful and user-friendly:

  • ▸Separate services: Your main site, blog, and app can live on completely different servers
  • ▸Different technologies: api.yourdomain.com can run Node.js while yourdomain.com runs a static site
  • ▸Development environments: staging.yourdomain.com for testing, yourdomain.com for production
  • ▸They're free: Subdomains are just DNS records — no extra cost
  • ▸Clean URLs: Much cleaner than yourdomain.com/app when the "app" is actually a separate service

Subdomains vs. Subdirectories

A question that comes up a lot: should your blog live at blog.yourdomain.com or yourdomain.com/blog? Both work, and the right answer depends on your setup.

Use a subdomain when the service is truly separate — different technology, different server, deployed independently. Use a subdirectory when it's part of the same application and you want to keep SEO authority consolidated.

Note: Google treats subdomains as separate entities for indexing purposes, though in practice the SEO difference is minimal for most sites. If SEO is critical, subdirectories are slightly safer; for everything else, use whichever is architecturally cleaner.

Getting a Free Subdomain

If you don't have your own domain yet, you can get a free, professional subdomain through Open Domains. Subdomains like myproject.is-a.dev are hosted on Cloudflare's DNS network, reviewed by a real person, and completely free.

💡 Tip: Free subdomains are perfect for side projects, portfolios, and experiments. When your project grows into a real product, you can migrate to your own domain and point it at the same server.