How to Create a Subdomain
WordPress & Managed Editor
Disclosure: Some links on this page are affiliate links — if you sign up through one, we may earn a commission at no extra cost to you. It never changes our ratings, rankings or verdicts: we don't sell hosting and take no pay-for-placement.
Who it's for
- Small business owners
- Developers separating environments
- Anyone launching a subsection of an existing site
What a Subdomain Is
A subdomain is a prefixed extension of an existing domain, such as blog.example.com or shop.example.com rather than example.com itself. See what is a subdomain? for the underlying concept. Subdomains are commonly used to run a blog, a staging copy, a members’ area, or an entirely different application on the same root domain. A subdomain can even point to a completely separate server or hosting account.
Before creating one, it’s worth asking whether you need it. Search engines generally treat a subdomain as a somewhat separate site, so content on blog.example.com may not pass authority to your main domain as directly as content at example.com/blog/. If the goal is to grow one site’s search presence, a subdirectory is often the simpler choice. Subdomains make more sense when the content is genuinely separate: a different platform, a different team, a staging copy, or an application with its own login.
Prerequisites Before Creating a Subdomain
- The root domain already active on the hosting account, since a subdomain extends an existing domain rather than standing alone.
- Panel access: cPanel, Plesk, or the host’s Domains section, where subdomains are typically created.
- A decision on what the subdomain will host, whether that’s a new install, a copy of existing content, or a pointer to another service, since this affects the steps after creation.
- Knowing where your DNS lives. If the domain’s nameservers are at your host, the panel handles DNS automatically. If they’re at your registrar or a service such as Cloudflare, you’ll have to add the record there yourself.
Step-by-Step: How to Create a Subdomain
Open the Domains Section and Set the Document Root
- Log in to the hosting panel and open the Domains or Subdomains section. In cPanel, this is usually its own icon, and on newer versions it lives inside a Domains page.
- Enter the subdomain prefix, such as
blog,shop, orstaging, and select the root domain it should attach to. Stick to lowercase letters, numbers, and hyphens, and keep it short. Choose a name you’d be happy to see on a business card, because changing it later means redoing links and certificates. - Set the document root. This is the folder on the server that the subdomain will serve. Panels usually suggest something like
public_html/blogor a folder named after the subdomain. Accept the suggestion unless you have a reason not to. Be aware that with a folder insidepublic_html, the same files are also reachable atexample.com/blog/, which can create duplicate content. Some hosts let you put the folder outsidepublic_htmlto avoid that.
Save and Let DNS Records Propagate
- Save. When your DNS is on the same hosting account, the panel normally creates the needed DNS records automatically, so no manual edit is required.
- Wait for DNS to propagate. A subdomain created in the panel usually resolves within minutes, because it relies on the nameservers already serving your domain. If you manage DNS elsewhere, add an A record pointing the subdomain to your server’s IP address, then wait. Changes can take from a few minutes to a few hours to appear everywhere, and your own computer may cache a failed lookup, so a device that says “not found” isn’t proof of a real problem.
- Put content in the subdomain’s folder. That might be a fresh platform install, uploaded files, or a copied environment. An empty folder shows a blank page or a listing.
Pointing a Subdomain at a Different Service
Sometimes a subdomain shouldn’t live on your hosting account at all. A help desk, an online store, or an app platform will often ask you to create a subdomain such as shop.example.com and point it at them. In that case you don’t create it in your host’s Domains tool. You create a DNS record at wherever your DNS is managed.
The two record types you’ll see are a CNAME, which points the subdomain at another hostname the service gives you, and an A record, which points it at an IP address. Use exactly what the service tells you. Two rules save headaches: a subdomain can’t hold both a CNAME and other records at the same name, and you must leave out the trailing root domain if your DNS tool adds it for you. Afterwards the service usually issues its own SSL certificate, which can take a little time.
SSL and the Padlock
This is the gotcha that catches most people. A new subdomain does not automatically get a valid certificate. The certificate on your main domain may cover only example.com and www.example.com, in which case visitors to the new subdomain see a browser security warning.
There are three common fixes. Many hosts run automatic SSL (often AutoSSL in cPanel) that issues a free certificate for each new subdomain within a short time, sometimes within the hour. If yours doesn’t, you can request one from the SSL section of the panel. The third option is a wildcard certificate, which covers every subdomain at once and is handy if you create many, though they can cost extra or need DNS validation. See how to install an SSL certificate. If you have a subdomain for a service hosted elsewhere, that service normally issues the certificate.
Verifying the Subdomain Works
Load the new subdomain URL in a browser and confirm it serves the intended content, not a blank listing or the host’s default page. Check that the padlock appears and that the address starts with https. Try it once in a private window, which avoids cached results.
If the subdomain points to a different server, check that its DNS record resolves to the correct external target and not to your original hosting account. A DNS lookup tool, or the dig or nslookup command on your computer, will show what the record really returns.
Common Errors When Creating a Subdomain
- Subdomain returns a 404 or “not found.” The document root was set to an empty or nonexistent folder. Recheck the path in the panel and confirm there’s an
indexfile inside. - Subdomain shows the main site’s content. A caching layer or a misconfigured document root is serving the parent domain’s files, or a wildcard setting is sending unknown names to the main site.
- DNS doesn’t resolve at all. If the subdomain is meant to point externally, the DNS record needs to be created manually rather than relying on the panel default. Also check that the domain’s nameservers are really the ones you think they are.
- SSL warning on the new subdomain. The certificate doesn’t include the subdomain. See the SSL section above.
- Login or cookies behave oddly between the main site and the subdomain. Cookies are scoped to a domain, so an app on a subdomain may not share a login with the main site unless it’s configured to.
- “Subdomain already exists” or a refusal to create one. It may be reserved, already in use as an addon domain, or you’ve reached your plan’s limit.
- Emails to the subdomain don’t arrive. A subdomain doesn’t get its own mailboxes by default. If you want addresses at it, the MX records have to be set up for that name.
Subdomains and Hosting Plan Limits
How many subdomains an account can create, and how much of the plan’s total resource limits each one consumes, depends on the tier. Entry-level shared hosting plans sometimes cap subdomain counts, while higher tiers and most business plans allow effectively unlimited subdomains. Each subdomain draws from the same overall storage, bandwidth, and CPU allowance as the rest of the account, unless it’s been deliberately set up on separate hosting. A busy application on a subdomain can slow your main site, because they compete for the same resources.
Managed and WordPress-focused hosts sometimes make subdomains harder, since the platform is built around one site per environment. In those cases you may have to add a new site rather than a subdomain, or ask support to do it.
FAQ
Is a subdomain the same as a subdirectory?
No. A subdomain (blog.example.com) is treated as a distinct address with its own document root and potentially its own DNS target. A subdirectory (example.com/blog) is simply a folder within the main domain’s existing structure.
Do subdomains cost extra? Not on most hosting plans. Subdomain creation is typically included at no extra charge, up to whatever limit the plan allows.
Can a subdomain point to a completely different host? Yes, by creating a DNS record (usually a CNAME or A record) at the domain’s DNS provider pointing the subdomain at the other host’s server, rather than creating it inside the main hosting account’s panel.
How long does a new subdomain take to work? Subdomains created directly in the hosting panel usually resolve within minutes, since they use the domain’s existing nameservers. Subdomains pointed at an external service can take up to the standard DNS propagation window, and a certificate may take a little longer still.
Will a subdomain hurt my search rankings? Not by itself, but search engines may not treat it as part of your main site. Use one when separation makes sense, and use a subdirectory when you want content to build the main site’s presence.