What Is a Subdomain and When Should You Use One?

Say you run greenleaf.co.ke. You’ve got your main site, but now you want a shop, a blog, and a place for clients to log in. Do you need three new domains? Usually, no. You need subdomains.
A subdomain is the bit that comes before your main domain name, like shop.greenleaf.co.ke or blog.greenleaf.co.ke. It lets you run separate sections or even separate websites under one domain you’ve already paid for.
How a subdomain works
Your domain is greenleaf.co.ke. Anything you put in front, separated by a dot, is a subdomain. You choose the name: shop, app, portal, mail, staging, careers. The word www is itself a subdomain, just one so common we stopped noticing.
The big benefit is cost and control. Subdomains are free to create. You don’t register them separately, you don’t pay renewal fees on them, and you can point each one to a different place: a different hosting account, a different platform, even a different country.
When a subdomain makes sense
A separate online shop
Your main site is a polished brochure built in WordPress, but you want a shop on Shopify. Point shop.yourbusiness.co.ke to Shopify and keep everything else where it is. Customers see one brand, and you get the best tool for each job.
A staging or test site
Before making big changes, clone your website to staging.yourbusiness.co.ke, test it there, then push it live. Nothing breaks in front of customers. See our guide to setting up a WordPress staging site.
A client portal or web app
Software that needs logins, like a booking system, member area or school results portal, is often better on its own subdomain: portal.yourschool.ac.ke. It keeps heavy application traffic away from your public site.
Regional or departmental sites
An NGO working in Turkana and Kilifi might run turkana.yourngo.or.ke and kilifi.yourngo.or.ke with local teams updating their own content.
Email and other services
Many third-party tools, such as email marketing platforms and help desks, ask you to create something like mail.yourbusiness.co.ke or help.yourbusiness.co.ke to verify your domain or host their pages.
When a subfolder is better
Here’s where people go wrong. A subfolder looks like yourbusiness.co.ke/blog. For content like blogs, FAQs and resource pages, a subfolder is usually the better call for SEO. Search engines can treat a subdomain as somewhat separate from the main site, so authority you’ve built on your main domain doesn’t always carry across as neatly. Putting your blog at /blog keeps everything feeding your main site’s strength.
A simple rule of thumb: if the content is part of the same website and audience, use a subfolder. If it’s a distinct tool, platform or audience, use a subdomain.
How to create a subdomain
In most cPanel hosting accounts it takes about two minutes:
- Log in to cPanel and open Domains (or Subdomains on older versions).
- Type the subdomain name you want, such as shop.
- Choose the domain it belongs to.
- Set the document root, the folder where its files will live. cPanel suggests one automatically.
- Click create.
If you want the subdomain to point to another service, say Shopify or a separate server, you’ll instead add a DNS record. For a platform that gives you a hostname, add a CNAME record with the subdomain name as the host and the platform’s address as the target. If it gives you an IP address, add an A record. Our post on pointing your domain to a different server explains the details.
Don’t forget SSL. Each subdomain needs to be covered by a certificate. Most hosts issue free certificates for subdomains automatically, but check for the padlock before you announce anything. If you’re running several, a wildcard certificate covers them all.
Mistakes to avoid
- Too many subdomains. Every one is something to maintain, secure and update. Create only what you’ll use.
- Forgetting old ones. An abandoned test.yourbusiness.co.ke running outdated software is a gift to hackers. Delete what you don’t need.
- Using a subdomain for your whole business. Don’t put your main site at site. something. Keep your core brand on the root domain.
- Wrong DNS type. A CNAME can’t be used on the root domain itself, but it works on subdomains. Mixing them up is the most common reason a new subdomain won’t load.
Start with the right domain
Every subdomain you ever create hangs off your main domain, so that name matters. If you haven’t secured yours yet, check availability for your .co.ke domain today, then build out from there. If you’re unsure how to structure your site, send us a message and we’ll help you plan it.