Skip to content

Subdomains: What They Are, When and How to Use Them

A guide to subdomains: what they are and how they differ from a subfolder, when to use them (blog/store/API/email/staging), how to create them with DNS records (A and CNAME), their effect on SEO, issuing SSL for them, and common mistakes, with examples and tables.

Domainsهند الدوسري27 min read
Illustration of a globe branching into blog, store and code cards, representing subdomains of one main domain
On this page

What is a subdomain, and why should you care?

Before you create a subdomain, you need to understand where it sits within the structure of a domain name. The domain you own, such as example.com, is not a single block but a chain of parts ordered from right to left (technically, from top to bottom in the DNS tree). A subdomain is the level that comes before your registered domain name, and you can create one yourself at any time, without anyone's approval and at no extra cost, because it sits inside the zone you fully control.

This point alone changes the way you think: buying one domain gives you a practically unlimited number of subdomains. You do not buy blog.example.com or shop.example.com; you buy example.com once, then create as many branches under it as you like by adding a DNS record. This is fundamentally different from new domains, each of which requires registration and annual renewal.

Anatomy of a domain nameblog.example.comSubdomainSubdomainThe name you chooseSLDExtensionTLDFull name (FQDN): blog.example.com
The parts of a domain name: the extension (a TLD such as com), the name you choose (SLD), and the optional subdomain (such as blog).

To understand the structure, let's break the address blog.example.com down into its components as DNS reads them:

PartTechnical nameExampleWho controls it
ExtensionTop-level domain (TLD).comThe global registry
Registered nameSecond-level domain (SLD)exampleYou (through the registrar)
Leading partSubdomainblogYou (through DNS)

In this example, example.com is the root (apex) domain, that is, the registered domain without any prefix. blog is a subdomain that adds a new level beneath it. Interestingly, www itself is technically nothing more than a subdomain, even though we are used to treating it as the site's "default name": www.example.com and example.com are two separate addresses as far as DNS is concerned, and they may point to the same place or to two different places.

Subdomains also let you nest: you can create a subdomain under a subdomain, such as staging.shop.example.com. This is a "third-level subdomain," and it works with exactly the same logic: just one more DNS record. In practice, you rarely go deeper than two or three levels, because the addresses become long and hard to remember.

DNS records explained gives you the complete foundation for understanding how these names are translated into actual addresses, which is what we will build on in the creation step.

Subdomain vs. root domain vs. subfolder

The most common confusion beginners fall into is mixing up three concepts that look similar but are radically different in structure, use and impact. Let's put them side by side with clear examples.

The root domain (example.com) is your main site, without any prefix. A subdomain (blog.example.com) is a separate branch managed through DNS that can live on a completely different server. A subfolder, or subdirectory (example.com/blog), has nothing to do with DNS at all: it is just a path inside the same site on the same server, managed by the site's software, not from the domain's control panel.

DimensionRoot domainSubdomainSubfolder
Exampleexample.comblog.example.comexample.com/blog
How it is createdWhen the domain is registeredA DNS record (A/CNAME)Creating a path/folder in the site
ServerThe main site's serverMay be a separate serverThe same server as the main site
Extra costAnnual registration feeNoneNone
SSL certificateThe root's certificateNeeds coverage for the subdomain (or a wildcard)Covered by the root's certificate
Technical independence—High (a different CMS/platform)Low (the same environment)
Ideal useThe core identityA technically separate serviceContent related to the site

The practical rule for choosing between a subdomain and a subfolder comes down to one question: is this section part of the same technical experience, or a separate service? If your blog runs on the same content management system and shares the design and users, a subfolder is simpler and stronger. But if the store runs on a different platform (such as a separate WooCommerce install or Shopify), or the dashboard is an app built on a different framework, a subdomain is the logical solution, because it separates the two environments completely.

The following decision table summarizes when to choose each one:

SituationBest fitReason
A blog on the same CMSSubfolderInherits the site's authority, unified management
A store on a different platformSubdomainFully separates the runtime environment
API/software serviceSubdomainTechnical and security separation, independent scaling
Dashboard / appSubdomainA different framework, independent routing
Marketing landing pagesSubfolderBenefits from the domain's SEO authority
A language version on the same systemSubfolder (/en)Easier management and clearer hreflang linking
Staging environmentSubdomainFull isolation from production

Common use cases for subdomains

Subdomains are not an abstract technical feature: they are a powerful organizational tool that solves real problems. Here are the most common uses, each with its own logic.

Blog and content

blog.example.com is a common choice when you want to run your blog on a different platform from your main site, for example when your site is built with a custom framework but you want WordPress for the blog. Note that this choice has an SEO cost we will discuss later, so think carefully before putting your blog on a separate subdomain if it will run on the same system.

Online store

shop.example.com or store.example.com makes sense when your store runs on an independent e-commerce platform. Many businesses start with a simple brochure site and then add a store on a separate subdomain through WooCommerce or an external platform, so the two sites stay technically independent while sharing the same identity and trust.

Application programming interface (API)

api.example.com is the near-universal standard convention for separating the API from the site's front end. This separation gives you deployment flexibility (a different server, independent CORS policies, separate scaling under load), and it keeps the service's code and infrastructure isolated from the marketing site.

Dashboard and user app

app.example.com or dashboard.example.com is a common pattern in SaaS products: the marketing site on the root, and the user app behind login on a separate subdomain. This allows the app to be built with a different framework (such as a single-page application, SPA) without clashing with the main site's routing.

Email and services

mail.example.com, webmail.example.com and smtp.example.com are subdomains for email services. Note an important distinction: receiving email is handled by an MX record, not by the subdomain itself, but accessing the webmail interface in a browser or configuring the server is usually done through a dedicated subdomain.

Staging environment

staging.example.com, dev.example.com or test.example.com are subdomains for testing changes before pushing them to production. Isolating the staging environment on a subdomain is essential, and it is always best to block search engines from indexing it (via robots.txt or password protection) so it does not show up in results and cause duplicate content.

Localization, languages, CDN assets and support

Other uses include localization (ar.example.com for an Arabic version on a separate system), static site assets via a CDN (cdn.example.com or static.example.com to speed up loading images and files), and the help center (help.example.com or support.example.com for a knowledge base on a platform such as Zendesk).

The following table brings the cases together with the common prefix and the DNS record type you usually need:

UseCommon prefixUsually hosted onTypical record type
BlogblogA separate platform or the same serverA or CNAME
Storeshop / storeAn independent e-commerce platformUsually CNAME
APIapiA separate server/serviceUsually A
Dashboardapp / dashboardA separate appA or CNAME
Email (interface)mail / webmailThe mail serverA
Staging environmentstaging / devAn isolated test serverA or CNAME
Localizationar / enA separate language systemA or CNAME
Assets/CDNcdn / staticA content delivery networkCNAME
Supporthelp / supportA knowledge base platformCNAME

How to create a subdomain through DNS

Creating a subdomain comes down to adding a single DNS record in your domain's management panel. The only question that matters: do you use an A record or a CNAME? The answer depends on where you want to point the subdomain.

Subdomain structureexample.comRoot domainblogBlogshopStoreapiAPImailEmailEach subdomain = a DNS record (A or CNAME) pointing to its targetA subdomain is a separate section that can live on its own server
Subdomains: from the root domain branch subdomains (blog, shop, api, mail), each a DNS record (A/CNAME) pointing to its destination, and each can be hosted on a separate server.

A record vs. CNAME record

An A record links the subdomain directly to a numeric IP address. You use it when you know the IP address of the server that will host the subdomain, such as your own VPS. A CNAME record, on the other hand, makes the subdomain an alias for another name (not an IP address). You use it when you point the subdomain to an external service that gives you a name rather than an address, such as an app hosting platform or a CDN, because the service may change its IP addresses behind the scenes without affecting you.

CriterionA recordCNAME record
Points toAn IP address (such as 192.0.2.10)Another domain name (such as app.netlify.app)
When to use itA server whose IP you knowAn external service that gives you a name
On the root @AllowedTechnically not allowed (conflicts with NS/SOA)
When the server's IP changesYou update it manuallyUpdates automatically (the provider manages the IP)
SpeedA single lookupAn extra lookup to resolve

An essential point many people get wrong: you cannot put a CNAME on the root domain @, because it conflicts with the root's mandatory NS and SOA records. That is why some providers use a special record called ALIAS or ANAME to emulate a CNAME on the root. On subdomains, though, a CNAME is perfectly allowed, and it is the cleanest option for external services.

Practical record examples

Suppose your domain is example.com and your server is at the address 192.0.2.10. Here are example records for the most common subdomains:

dns
; Blog subdomain on your own server (A)
blog    IN  A      192.0.2.10

; API subdomain on another server (A)
api     IN  A      198.51.100.20

; Store subdomain on an external platform (CNAME)
shop    IN  CNAME  shops.myplatform.com.

; Dashboard on an app hosting service (CNAME)
app     IN  CNAME  myapp.vercel-dns.com.

; Assets via a CDN (CNAME)
cdn     IN  CNAME  d111abc.cloudfront.net.

Note the dot at the end of the CNAME values (shops.myplatform.com.): it indicates an absolute name (FQDN). In graphical control panels you usually do not type this dot; the tool handles it. In the "Name" or "Host" field, type only the prefix (blog), not the full address, because the panel appends your domain name automatically.

Wildcard subdomains

If you want every undefined subdomain to point to one place, you use a wildcard record with the * symbol:

dns
; Any undefined subdomain points to the server (useful for multi-tenant platforms)
*       IN  A      192.0.2.10

This is very useful in SaaS applications where every customer gets their own subdomain (client1.example.com, client2.example.com) without creating a record for each one. But be careful: the wildcard catches everything you have not explicitly defined and may cause unexpected behavior, and securing it with SSL requires a wildcard certificate, as we will see.

Through the hosting control panel

Many hosting control panels (cPanel and others) offer a shortcut that combines two steps in one go: creating the DNS record and creating a folder on the server to host the subdomain's content. The following table summarizes the steps in the most common environments:

EnvironmentPathWhat you do
cPanelDomains → SubdomainsType the prefix, choose the root, set the document root
PleskWebsites & Domains → Add SubdomainType the name and choose the web folder
The domain registrar's panelDNS / Zone EditorAdd an A or CNAME record manually
CloudflareDNS → Records → Add recordChoose the type, enter the name and value
A cloud providerDNS ZoneAdd a record set with the type and value

An important note: the hosting panel only creates the DNS record if your domain's nameservers point to it. If you manage DNS somewhere else (such as Cloudflare), you have to add the record there, not in the hosting panel. This point confuses many people when DNS management is separated from hosting. See connecting a domain to hosting to understand the relationship between nameservers and the hosting panel in detail.

Hosting a subdomain on a separate server or provider

One of the most powerful features of subdomains is that each one can live on completely different infrastructure. This architectural separation opens up many practical options.

Imagine this realistic scenario: your main site example.com is on shared hosting, your blog blog.example.com is WordPress on another server, api.example.com is on a powerful VPS, and cdn.example.com is on a global content delivery network. Four services, four environments, one domain, one unified experience for the user. The user notices no transition; for them, everything is "on the same site," while behind the scenes the load is spread across completely independent infrastructures, each with its own resources, security and limits.

The mechanism is simple: each DNS record points its subdomain to the right destination. The root points to the shared hosting server through an A record, the blog to its server through another A record, the API to the VPS address, and the CDN to the network's name through a CNAME. The following table shows this distribution:

SubdomainDestinationRecord typeValue (example)
@ (root)Shared hostingA192.0.2.10
blogWordPress serverA203.0.113.30
apiVPSA198.51.100.20
cdnCDN networkCNAMEd111abc.cloudfront.net.

The biggest benefit here is isolation: if the blog's server goes down, the main site and the API keep working. And if the API comes under heavy load, you can upgrade its server alone without touching the rest. This pattern is the foundation of modern distributed architectures, and it all starts with a single DNS record per subdomain. As your project grows, you may need a dedicated server for one of the subdomains.

There is a second, less obvious but important benefit: separation of responsibilities and permissions. When the API lives on a separate server, the development team can have full control over it without touching the marketing site's server, which the marketing team manages. This administrative separation reduces risk: a mistake in deploying an app update will not take down the homepage, and a vulnerability in a WordPress plugin on the blog will not reach the API's sensitive data. Each subdomain becomes an independent "containment zone."

Even so, this separation has a cost you need to be aware of: operational complexity. Four servers mean four places to monitor, four SSL certificates to track, and four potential points of failure. Do not split subdomains onto separate infrastructure just because you can; do it when the technical, security or scaling separation is genuinely justified. For small projects, running several subdomains on the same server (in separate folders) may be simpler and more efficient, and you keep the freedom to separate them later simply by editing a DNS record, without changing any address the user sees.

Issuing SSL certificates for subdomains

This is one of the points that cause the most silent errors. Many people create a subdomain, point it correctly, and are then surprised by a "Your connection is not private" message, because the site's SSL certificate does not cover the new subdomain.

The decisive rule: an SSL certificate is issued for specific names. A certificate issued for example.com and www.example.com does not automatically cover blog.example.com. You have two options for securing subdomains:

OptionCoversWhen to choose itNote
A certificate per subdomainOne specific subdomainA few fixed subdomainsSeparate renewal for each one
A wildcard certificateAll subdomains *.example.comMany or changing subdomainsDoes not cover a deeper level or the root

Free certificates from Let's Encrypt support both types: a regular certificate in which you add each subdomain name explicitly, or a wildcard certificate for all subdomains at one level. Note an important restriction: a wildcard certificate for *.example.com covers blog.example.com and shop.example.com, but it does not cover staging.shop.example.com (a deeper level) or example.com itself (the root). So in practice, comprehensive coverage means a certificate for example.com and *.example.com together.

Most modern hosting control panels issue and renew a certificate automatically for any subdomain you create, as long as the subdomain actually points to the server at the time of issuance (because validation requires the subdomain to have propagated). If you created the subdomain and it has not propagated yet, issuing the certificate may fail: wait for propagation and then try again. For more depth on certificate types and activation, see the guide to installing SSL on your site.

A practical point: if your subdomain is hosted on an external service (such as an app platform), the platform usually issues the subdomain's certificate automatically once you add the correct CNAME, so you do not need to do anything about SSL yourself in that case.

The SEO impact of subdomains

This is the most controversial topic in the world of subdomains, and it deserves a precise explanation, free of exaggeration.

The historical debate is this: do search engines treat a subdomain as a separate site or as part of the parent site? The practical position today: search engines can understand the relationship between the subdomain and the root, but in many cases they treat a subdomain as a relatively separate entity when it comes to aggregating site authority (Domain Authority). A subfolder, on the other hand, inherits the parent site's authority directly and more clearly.

Translated into a practical decision: if your goal is to build concentrated topical authority on a single domain (such as a content blog that you want to benefit from your main site's strength and support it in return), a subfolder (example.com/blog) is usually the stronger SEO choice. But if the section is technically and topically different (a store on a platform, an app, an API), a subdomain is justified, and the negative SEO effect is secondary, because these sections are not built to target content keywords in the first place.

CriterionSubdomain (blog.example.com)Subfolder (example.com/blog)
Inheriting site authorityPartial / weakerFull / direct
Concentration of topical authoritySplit across two entitiesConcentrated on one entity
Technical flexibilityHigh (a different platform)Limited (the same environment)
Ease of SEO managementHarder (effectively two sites)Easier (one site)
Best forTechnically separate servicesContent related to the site

So the golden rule is: choose a subfolder for related content, and a subdomain for technical separation. Do not put your blog on a separate subdomain just because it "looks cleaner" if it will run on the same system: you will lose concentrated authority for nothing in return. And in every case, make sure hreflang and canonical are linked correctly if you spread content around, and block indexing of staging environments completely.

Propagation and TTL

After you add the subdomain's record, it does not appear everywhere immediately. The reason is the caching spread across DNS servers around the world.

Every DNS record has a TTL (time to live) value in seconds, which determines how long resolvers keep a copy of the record before querying again. If the TTL is 3600, a given resolver may keep the old copy for a full hour. This explains why your new subdomain works for you while a friend cannot reach it yet, or why a change to an existing subdomain's IP address was slow to show up.

TTL valueDurationWhen it fits
3005 minutesBefore making changes (faster propagation)
36001 hourThe balanced default
86400A full dayStable records that do not change

A practical tip for professionals: before you plan to change the destination of an existing subdomain, lower the TTL to 300 and wait for the old value to propagate, then make the change; that way the new value propagates quickly. Creating a brand-new subdomain usually does not suffer from the propagation problem, because resolvers have no old copy of it in the first place, so it appears relatively quickly (usually minutes to an hour).

To check your subdomain's propagation and find out the actual value DNS servers see, use command-line tools:

bash
# Check the subdomain's record with dig
dig blog.example.com +short
# Expected: 192.0.2.10

# Show the record type and the actual TTL
dig blog.example.com

# Check the CNAME
dig shop.example.com CNAME +short

# Query a specific public DNS server (Cloudflare)
dig @1.1.1.1 api.example.com +short

On Windows, or as a quick alternative:

bash
# On Windows / Linux / macOS
nslookup blog.example.com

# Specify a particular DNS server to query
nslookup blog.example.com 8.8.8.8

If dig gives you the correct address from a public server such as 1.1.1.1, the record has propagated globally, even if it does not show up on your local network yet because of your computer's or your provider's cache.

Common mistakes and how to fix them

Most subdomain problems recur in well-known patterns. The following table links each symptom to its root cause and direct fix:

SymptomPossible causeFix
NXDOMAIN / the subdomain does not existThe DNS record was not added or has not propagatedCheck the record, wait for propagation, verify with dig
"Your connection is not private"The certificate does not cover the subdomainIssue a certificate for the subdomain or a wildcard
The subdomain opens the main siteWrong document root, or no routingSet the folder in the hosting panel
A CNAME on the root failsTechnically forbidden on @Use A or ALIAS/ANAME
The subdomain works for you but not for othersThe cache/TTL has not expired yetWait for the TTL to expire, clear the local cache
The wildcard does not work for a specific subdomainAn explicit record overrides itRemember that an explicit record takes precedence over *
Error issuing the subdomain's certificateThe subdomain had not propagated at issuance timeWait for propagation and request the certificate again
Duplicate content in search resultsThe staging environment is indexedBlock indexing with robots.txt or a password

The most common mistake of all is trying to put a CNAME on the root, or forgetting that an explicit record overrides the wildcard. The second most painful mistake is SSL not covering the subdomain, because it only shows up when a user visits the subdomain, and days may pass before you notice it. Make testing the subdomain over HTTPS part of your routine after every creation.

A final expert tip: keep a documented record of every subdomain you have created and where each one points. As the project grows, subdomains pile up, and "orphaned" subdomains (pointing to services that were cancelled) become a potential security hole through what is known as "subdomain takeover," where an attacker takes over an abandoned service that your subdomain still points to.

Frequently asked questions

Is a subdomain free, or does it need a separate purchase?

A subdomain is completely free. You own the root domain, and you can create a practically unlimited number of branches under it by adding DNS records, at no extra cost. The only fee is the annual renewal of the root domain. This is different from buying a completely separate new domain.

How many subdomains can I create?

In practice there is no meaningful limit on the DNS side: you can create thousands of branches. The only restriction may come from your hosting provider, which may limit the number of hosted subdomains on your plan, but the DNS records themselves cost nothing and are effectively unlimited.

What is the difference between a subdomain and a subfolder, in simple words?

A subdomain (blog.example.com) is a separate address managed through DNS that can live on a different server, while a subfolder (example.com/blog) is just a path inside the same site on the same server. The first separates things technically; the second keeps everything unified. For content related to the site, a subfolder is usually better for SEO.

Does a subdomain hurt my search engine rankings?

Not in itself, but it may not benefit from your main site's authority as strongly as a subfolder does. If the section is content you want to inherit and support your site's strength, a subfolder is usually better. For technically separate services (an API, an app), a subdomain is justified without worrying about content SEO.

Should I use an A record or a CNAME to create the subdomain?

Use an A record when you point the subdomain to a server whose IP address you know (such as a VPS). Use a CNAME when you point it to an external service that gives you a name rather than an address (such as an app platform or a CDN), because the service may change its addresses behind the scenes without affecting you.

Does my site's SSL certificate cover subdomains automatically?

No. A regular certificate for example.com and www.example.com does not cover blog.example.com. You need either a separate certificate for each subdomain, or a wildcard certificate (*.example.com) that covers all subdomains at one level. Most hosting control panels issue certificates for subdomains automatically once they have propagated.

How long does a new subdomain take to appear?

A brand-new subdomain usually appears within minutes to an hour, because resolvers do not have an old copy of it. Changing the destination of an existing subdomain, however, may take until the old TTL value expires (sometimes up to 24 hours). Check propagation with dig or nslookup.

Can I put a CNAME on the root domain?

No. Technically, you cannot put a CNAME on the root @, because it conflicts with the mandatory NS and SOA records. Some providers offer an ALIAS or ANAME record to emulate this behavior on the root. On subdomains, though, a CNAME is perfectly allowed.

What is a wildcard subdomain?

It is a record using the * symbol that makes any subdomain not explicitly defined point to a single destination, such as * IN A 192.0.2.10. It is very useful for SaaS applications that give every customer their own subdomain. Remember that any explicit record overrides the wildcard, and that securing it requires a wildcard certificate.

Does a subdomain affect my domain's email?

Creating a subdomain for your site does not affect your email, because email is managed through a completely separate MX record. You can create a mail.example.com subdomain to reach the webmail interface without touching the mail delivery routing defined by the MX record.

How do I make sure my subdomain is working correctly?

Use dig blog.example.com +short to check the IP address, or nslookup on Windows. Make sure you open the subdomain over https://, not just http://, to check the certificate, and query a public resolver such as 1.1.1.1 to confirm global propagation, not just on your local network.

Summary

A subdomain is a simple tool at its core (a single DNS record), but it has a powerful organizational and technical impact. Remember the basic rules: a subdomain is free and unlimited, you create it with an A record (for a server whose IP you know) or a CNAME (for an external service), and you never put a CNAME on the root. For related content, prefer a subfolder to preserve SEO authority, and for technically separate services, use a subdomain with confidence. And never forget to secure the subdomain with an SSL certificate that covers it, and to check propagation before declaring it "ready."

Start by working out what you actually need, create the right record, verify it and secure it, and you will find that managing subdomains becomes a simple routine over time. To choose the main name all your subdomains will be built on, see the guide to choosing a strong domain name.

Sources

Frequently asked questions

Is a subdomain free, or does it need a separate purchase?

A subdomain is completely free. You own the root domain, and you can create a practically unlimited number of branches under it by adding DNS records, at no extra cost. The only fee is the annual renewal of the root domain. This is different from buying a completely separate new domain.

How many subdomains can I create?

In practice there is no meaningful limit on the DNS side: you can create thousands of branches. The only restriction may come from your hosting provider, which may limit the number of hosted subdomains on your plan, but the DNS records themselves cost nothing and are effectively unlimited.

What is the difference between a subdomain and a subfolder, in simple words?

A subdomain (blog.example.com) is a separate address managed through DNS that can live on a different server, while a subfolder (example.com/blog) is just a path inside the same site on the same server. The first separates things technically; the second keeps everything unified. For content related to the site, a subfolder is usually better for SEO.

Does a subdomain hurt my search engine rankings?

Not in itself, but it may not benefit from your main site's authority as strongly as a subfolder does. If the section is content you want to inherit and support your site's strength, a subfolder is usually better. For technically separate services (an API, an app), a subdomain is justified without worrying about content SEO.

Should I use an A record or a CNAME to create the subdomain?

Use an A record when you point the subdomain to a server whose IP address you know (such as a VPS). Use a CNAME when you point it to an external service that gives you a name rather than an address (such as an app platform or a CDN), because the service may change its addresses behind the scenes without affecting you.

Does my site's SSL certificate cover subdomains automatically?

No. A regular certificate for example.com and www.example.com does not cover blog.example.com. You need either a separate certificate for each subdomain, or a wildcard certificate (*.example.com) that covers all subdomains at one level. Most hosting control panels issue certificates for subdomains automatically once they have propagated.

How long does a new subdomain take to appear?

A brand-new subdomain usually appears within minutes to an hour, because resolvers do not have an old copy of it. Changing the destination of an existing subdomain, however, may take until the old TTL value expires (sometimes up to 24 hours). Check propagation with dig or nslookup.

Can I put a CNAME on the root domain?

No. Technically, you cannot put a CNAME on the root @, because it conflicts with the mandatory NS and SOA records. Some providers offer an ALIAS or ANAME record to emulate this behavior on the root. On subdomains, though, a CNAME is perfectly allowed.

What is a wildcard subdomain?

It is a record using the * symbol that makes any subdomain not explicitly defined point to a single destination, such as * IN A 192.0.2.10. It is very useful for SaaS applications that give every customer their own subdomain. Remember that any explicit record overrides the wildcard, and that securing it requires a wildcard certificate.

Does a subdomain affect my domain's email?

Creating a subdomain for your site does not affect your email, because email is managed through a completely separate MX record. You can create a mail.example.com subdomain to reach the webmail interface without touching the mail delivery routing defined by the MX record.

How do I make sure my subdomain is working correctly?

Use dig blog.example.com +short to check the IP address, or nslookup on Windows. Make sure you open the subdomain over https://, not just http://, to check the certificate, and query a public resolver such as 1.1.1.1 to confirm global propagation, not just on your local network.