
A subdomain such as blog.yoursite.com is created for free in your DNS zone. Definition, step-by-step setup (A or CNAME), HTTPS, SEO impact and the risks to avoid.
By Mouhamed BANKOLE, CEO at ITNET Technologies · Updated November 9, 2026 · Reading time: 9 min
Want to launch a blog, a customer area or a test version of your website without buying a new domain name? That is exactly what a subdomain is for: blog.yoursite.com, app.yoursite.com or test.yoursite.com can be created in a few minutes in your DNS zone. You still need to pick the right record, secure the address with HTTPS and understand the impact on your search rankings. This guide answers the questions people actually ask: what a subdomain is for, how to create one step by step, subdomain or subdirectory, and which mistakes to avoid.
In short
- A subdomain is a prefix added to the left of your domain (blog.yoursite.com) and can point to a different server than your main website.
- It is created for free in the DNS zone with an A record (to an IP address) or a CNAME record (to another name).
- HTTPS is handled separately: one certificate per subdomain, or a wildcard certificate that requires DNS validation.
- For SEO, treat a subdomain as a separate site: keep it for truly separate uses (application, customer area, another language).
- Delete unused subdomains: a record pointing to a cancelled service can be hijacked.
Contents
- What is a subdomain?
- What is a subdomain used for?
- What is the difference between a domain, a subdomain and a subdirectory?
- How do you create a subdomain in your DNS zone?
- Should a subdomain use an A record or a CNAME?
- How do you enable HTTPS on a subdomain?
- Is a subdomain good or bad for SEO?
- What are the security risks of subdomains?
- How many subdomains can you create?
What is a subdomain?
A subdomain is a subdivision of your domain name, written to its left and separated by a dot: in blog.yoursite.com, "blog" is the subdomain of yoursite.com.
The DNS is organized as a tree: each level added on the left creates a more specific name, and the domain owner can create as many as they like under their name (RFC 1034, IETF). In practice:
- yoursite.com is the domain you registered with a registrar;
- www.yoursite.com is already a subdomain, the most common of all;
- blog.yoursite.com, app.yoursite.com or mail.yoursite.com are others;
- api.v2.yoursite.com is a second-level subdomain, under v2.yoursite.com.
You do not buy a subdomain: it is part of the domain you already own. If domains, extensions and registrars are still unclear, start with our domain name guide.
What is a subdomain used for?
A subdomain separates a service from the main website, often because it runs on another server, another tool or targets another audience.
The most common uses:
- application or customer area: app.yoursite.com, hosted on a VPS separate from the showcase site;
- test environment: test.yoursite.com or staging.yoursite.com, to validate an update before production;
- API: api.yoursite.com, which you can move from one server to another without touching the website;
- third-party tool: an online store, help center or email marketing platform that asks you for a CNAME;
- email: mail.yoursite.com for webmail, or a sending subdomain dedicated to campaigns;
- agency client sites: client1.youragency.com for mockups and staging.
Pro tip: a sending subdomain for your newsletters keeps the reputation of your campaigns apart from that of your everyday emails. Give it its own SPF and DKIM records.
For agencies hosting several websites, our article on the VPS for web agencies explains how to isolate each client.
What is the difference between a domain, a subdomain and a subdirectory?
The domain is the address you register, the subdomain is a prefix managed in the DNS, and the subdirectory is simply a folder of the same site (yoursite.com/blog).
| Criterion | New domain | Subdomain | Subdirectory |
|---|---|---|---|
| Example | yourblog.com | blog.yoursite.com | yoursite.com/blog |
| Cost | a registration to renew | free | free |
| Where is it configured? | at the registrar | in the DNS zone | on the web server or CMS |
| Can it point to another server? | yes | yes | no, normally the same one |
| HTTPS certificate | separate | separate or wildcard | the site's own |
| Cookies | separate | can be shared with the domain | the site's own |
| Typical case | new brand | application, testing, third-party tool | blog, guides, categories |
How to choose:
- same content, same audience: go for a subdirectory;
- separate technical service: go for a subdomain;
- independent brand or business: get a new domain.
How do you create a subdomain in your DNS zone?
You create a subdomain by adding a record to the domain's DNS zone, then configuring the destination server so that it answers for this new name.
Step by step:
- open the DNS zone of your domain in your registrar's or DNS host's customer area;
- add a record: name
blog, typeA(orAAAAfor IPv6), value = the server's IP address; - or instead: name
blog, typeCNAME, value = the name given by the third-party service (for exampleyourstore.platform.com.); - set the TTL: a low value while testing, a higher one once the setup is stable;
- declare the subdomain on the server: Apache virtual host, nginx
serverblock or the domain setting in your hosting control panel; - check resolution with
dig blog.yoursite.comornslookup blog.yoursite.com; - enable HTTPS (see below), then test in a browser.
If the new name does not answer right away, caching is usually the cause: our article on DNS propagation explains the delays and how to check them.
At Wayhost, DNS management lets you manage A, MX, CNAME and TXT records from the interface and advertises unlimited subdomain creation, with DNSSEC included (checked on November 9, 2026).
Should a subdomain use an A record or a CNAME?
Use an A record when you know your server's IP address, and a CNAME when a third-party service gives you a destination name whose address may change.
| Situation | Record | Value |
|---|---|---|
| Subdomain to your own VPS or server | A (and AAAA for IPv6) | the server's IP address |
| Subdomain to a SaaS platform | CNAME | name given by the platform |
| Subdomain to the same server as the website | CNAME to the domain, or A | main domain or its IP |
| Subdomain that receives email | MX (+ A of the mail server) | mail server name |
| All undeclared subdomains | A or CNAME on * (wildcard) | default IP or name |
Three rules that prevent most outages:
- a CNAME cannot coexist with any other record with the same name (RFC 1034, IETF): no CNAME and TXT on
blogat the same time; - no CNAME at the root of the domain (yoursite.com), for the same reason, since the root already carries other records;
- a subdomain name is at most 63 characters per level and 255 in total (RFC 1035, IETF).
How do you enable HTTPS on a subdomain?
Each subdomain needs a certificate that covers it: either a certificate that names it, or a wildcard certificate (*.yoursite.com) that covers every subdomain at one level.
The options:
- one certificate per subdomain: the simplest, with standard HTTP validation on the server hosting the subdomain;
- a multi-name certificate: a single certificate listing several specific subdomains;
- a wildcard certificate: Let's Encrypt only issues it with DNS validation (the DNS-01 challenge), which requires adding a TXT record to the zone (Let's Encrypt).
Points to watch:
- a wildcard covers only one level: *.yoursite.com protects blog.yoursite.com, not api.v2.yoursite.com;
- automate renewal, especially for the wildcard, by giving your tool API access to the DNS zone;
- redirect HTTP to HTTPS on every subdomain, not just on the main website.
Is a subdomain good or bad for SEO?
A subdomain is neither good nor bad in itself, but it has to be monitored and worked on like a separate site, whereas a subdirectory directly benefits from the work done on the main website.
What is established:
- Search Console offers a "domain" property that groups every subdomain and protocol, while a "URL prefix" property tracks only one subdomain (Search Console Help);
- each subdomain has its own robots.txt file, served at its root (Google Search Central).
Analysis: in practice, a subdirectory remains the simplest choice for a blog or guides meant to strengthen your website. A subdomain makes sense for a distinct service (application, customer area, technical documentation) or another language run by another team.
Good practices if you choose a subdomain:
- link to it from the main site and back, with links that help the reader;
- block indexing of test environments (password or
noindextag) to avoid duplicate content; - declare a sitemap specific to the subdomain;
- track it in Search Console through a domain property.
What are the security risks of subdomains?
The main risk is the takeover of a forgotten subdomain: if a CNAME still points to a service you cancelled, a third party can claim that service and publish content under your name (OWASP).
Other points to watch:
- cookies: a cookie set with the
Domain=yoursite.comattribute is sent to all its subdomains (MDN), including a less protected test subdomain; - exposed test environments: old versions, weak passwords, copied real data;
- wildcard DNS: it makes any name answer, including names you never planned.
Good habits:
- keep an inventory of subdomains and who owns each one;
- delete the DNS record first, before cancelling the service it points to (OWASP);
- enable DNSSEC to protect your zone's answers;
- protect internal subdomains with a password or IP address restrictions.
How many subdomains can you create?
Technically, the DNS sets no maximum number of subdomains: the limit comes from your DNS provider or hosting plan, and from the maximum length of names (RFC 1035, IETF).
What limits you in practice:
- the DNS plan: some providers cap the number of records per zone;
- the hosting plan: shared hosting may limit how many subdomains or sites you can declare;
- management: every subdomain you open has to be secured, renewed and monitored.
To host several subdomains with different configurations, a VPS lets you declare as many virtual hosts as you need, with root access. For a showcase site and one or two subdomains, web hosting is often enough. And if your domain and hosting are with two different providers, our guide to connecting a domain to your hosting explains the settings.
Frequently asked questions
What is a subdomain, in plain words?
It is a prefix placed in front of your domain name, like "blog" in blog.yoursite.com. It works as a full address in its own right. It can point to the same server as your website or to another one.
Do you have to pay to create a subdomain?
No, a subdomain is part of the domain you already own. You only need to add a record to the DNS zone. Only hosting the content or a paid certificate may cost something.
How long does it take for a subdomain to work?
A new record often answers within a few minutes. If an old answer is still cached by your internet provider, you have to wait for the TTL to expire. Test with dig to see what DNS servers return.
Can a subdomain point to another hosting provider?
Yes. That is one of its main benefits. Add an A record to the new server's IP address, or a CNAME to the name given by the service, then declare the subdomain with that host.
Subdomain or subdirectory for a blog?
For a blog meant to strengthen your website, a subdirectory (yoursite.com/blog) is the simplest choice. A subdomain makes sense if the blog runs on a different tool or server. In that case, link the two sites to each other.
Does my SSL certificate cover my subdomains?
Only if it names them or if it is a wildcard certificate. A certificate issued for yoursite.com does not automatically protect blog.yoursite.com. Check the list of names in the certificate.
Is www a subdomain?
Yes, www.yoursite.com is a subdomain of yoursite.com. Pick a single version, with or without www. Redirect the other one to it to avoid duplicates.
How do you delete a subdomain safely?
Remove the DNS record first, then delete the site or service it pointed to. In the reverse order, an orphaned CNAME can be hijacked. Also remove the subdomain from your certificates and from Search Console.
Key takeaways
- A subdomain is free and is created in your domain's DNS zone.
- A to an IP address, CNAME to a name: the choice depends on the destination.
- HTTPS is handled per subdomain or with a wildcard certificate validated through DNS.
- For SEO, keep subdomains for truly separate services and prefer subdirectories for content.
- Delete unused records to prevent takeovers.
To manage your subdomains and records from a single interface, with DNSSEC included, discover Wayhost DNS management.
Article written by Mouhamed BANKOLE, CEO at ITNET Technologies.