What Is a Subdomain? Examples, Uses and How to Create One
Quick answer
A subdomain is an extra part added in front of your domain name, such as blog.example.com or shop.example.com. It lets you run a separate section, app or service under your main domain at no extra registration cost. You create one by adding a DNS record, usually an A or CNAME record, at your DNS provider.
How a domain name is structured
Domain names are read from right to left, from the most general part to the most specific:
| Part | Example | What it is |
|---|---|---|
| Top-level domain (TLD) | .com | The extension, run by a registry |
| Second-level domain | example.com | The name you register |
| Subdomain | blog.example.com | A prefix you create yourself |
Each part is separated by a dot. You can even nest subdomains, such as help.eu.example.com, though most sites rarely need more than one level.
Common subdomain examples
- www.example.com: the traditional web address.
- blog.example.com: a blog, often on a different platform from the main site.
- shop.example.com: an online store run on an e-commerce platform.
- app.example.com: a web application that customers log in to.
- help.example.com or support.example.com: a help centre.
- mail.example.com: a webmail login.
- staging.example.com: a private test copy of the site.
Subdomain vs. subfolder
A subfolder (also called a subdirectory) puts content in a path on the main site, like example.com/blog, instead of a separate subdomain.
| Subdomain (blog.example.com) | Subfolder (example.com/blog) | |
|---|---|---|
| Setup | DNS record pointing to any server or platform | Must run on the same site or behind the same server |
| Best for | Separate apps, stores or help centres on other platforms | Content that belongs to the main site |
| Management | Can be run by a different team or tool | One site to manage and measure |
If your blog and main site run on the same platform, a subfolder is usually simpler. If your store runs on Shopify and your main site on WordPress, a subdomain is often the practical choice.
How to create a subdomain
- Log in to your DNS provider. This is usually your registrar, unless you’ve pointed your nameservers elsewhere (for example to Cloudflare or your host).
- Find the DNS records page for your domain.
- Add a record with the subdomain name in the Name or Host field (for example, just
blog):- Use a CNAME record to point the subdomain at another hostname, such as a platform address your provider gives you.
- Use an A record to point it at an IPv4 address (or an AAAA record for IPv6).
- Save the record and add the subdomain in the platform you’re connecting, so it knows to serve your site.
- Wait for it to take effect. New records usually work within minutes, though caches can take a few hours.
Wildcard subdomains
A wildcard record (*.example.com) answers for any subdomain that doesn’t have its own record. It’s useful for apps that give each customer their own address, such as customer1.example.com, but should be used deliberately, since it makes every made-up subdomain resolve.
Keep your domain safe
Subdomains depend on the main domain. If the main domain expires, every subdomain stops working too. Turn on auto-renew, and remove DNS records for services you no longer use, since a forgotten record pointing at a cancelled service can let someone else take over that subdomain.
New to domains? Start with how to buy a domain name, or see how subdomains fit into building a website.
Frequently asked questions
Is www a subdomain?
Technically, yes. www.example.com is a subdomain of example.com. Most sites make the www and bare versions show the same site, with one redirecting to the other.
Do subdomains cost extra?
No. Once you own a domain, you can create subdomains for free in your DNS settings. Some hosting plans limit how many you can host, but the subdomains themselves cost nothing.
Is a subdomain or a subfolder better for SEO?
Google says it handles both well. Subfolders keep everything in one site, which is simpler to manage and measure. Subdomains make sense when a section runs on a different platform or serves a clearly separate purpose.
How many subdomains can I have?
DNS itself allows a very large number. In practice, the limit is set by your DNS provider or hosting plan.
Sources