Root Domain vs Subdomain โ The Complete Guide
Published August 27, 2026 ยท 10 min read ยท By Domain Extractor Team
"Is blog.example.com a different domain than example.com?" That single question hides most of what makes DNS confusing. This guide answers it definitively โ with examples, SEO implications, and the reason why co.uk and github.io don't behave the way you'd expect.
Quick answer
example.comis a root domain (also called the "registrable" or "apex" domain).blog.example.comis a subdomain ofexample.com.- DNS treats them as separate hosts. SEO treats them as related but not identical.
- Multi-part suffixes like
.co.ukandgithub.iochange the answer โ see the Public Suffix List section.
1. The DNS hierarchy
DNS is a tree. Each dot moves you one level up. Reading right to left:
. โ root (invisible; the trailing dot no one types)
|
com โ top-level domain (TLD)
|
example โ the label registered with a registrar
/ \
blog shop โ subdomains (created by the owner)
|
2024 โ sub-subdomain
The full name reading bottom-up: 2024.blog.example.com. Each level below example.com is created and controlled by whoever owns example.com โ no need to talk to a registrar.
2. What can you actually own?
When you buy a domain, you're leasing a specific label under a specific TLD. In the diagram above, the buyer registered example under com, giving them ownership of example.com plus everything underneath it. So a subdomain like blog.example.com is not something you buy separately โ it's something you create with a DNS record after you already own the parent.
The technical name for the shortest domain you can actually register is the registrable domain. For a.b.c.example.com, the registrable domain is example.com. This distinction matters more than it sounds โ see the SEO section below.
3. Types of "subdomain" people talk about
| Example | Also called | Common purpose |
|---|---|---|
www.example.com | Canonical / bare-domain redirect | Legacy convention; most sites now serve both example.com and www. |
blog.example.com | Content subdomain | Separate blog CMS from main product |
api.example.com | Service subdomain | Cleanly separate API from marketing site |
shop.example.com | Product subdomain | Different tech stack (e.g. Shopify) |
de.example.com, fr.example.com | ccTLD alternative | Language variants without country-code domains |
staging.example.com | Environment | Non-production deployment |
tenant1.example.com | Multi-tenant | SaaS with per-customer subdomain |
4. The Public Suffix List โ where intuition breaks
The naive rule "the registrable domain is the last two labels" is wrong for a huge fraction of the internet. Consider:
example.co.ukโ you register the wholeexample.co.uk. The last two labels would give youco.uk, which nobody can own.user.github.ioโ GitHub ownsgithub.ioand gives each customer a subdomain. The "domain" a specific user controls isuser.github.io, notgithub.io.myapp.appspot.comโ same pattern for Google App Engine.example.pvt.k12.ma.usโ the US education namespace goes really deep.
The Public Suffix List (PSL) is a Mozilla-maintained community list of every "public" prefix โ the parts of the DNS tree under which anyone can register a subdomain. Once you know the PSL, the rule becomes:
The registrable domain is the longest matching public suffix, plus one more label to the left.
Applying the rule:
| Hostname | Public suffix | Registrable domain |
|---|---|---|
www.example.com | com | example.com |
a.b.example.co.uk | co.uk | example.co.uk |
alice.github.io | github.io | alice.github.io |
staging.myapp.appspot.com | appspot.com | myapp.appspot.com |
5. Why cookies care about this
Browsers use the PSL to decide whether one host can set a cookie for another. Without the PSL, an evil site at attacker.co.uk could set a cookie for .co.uk, which would then be sent to every other .co.uk site. The PSL tells the browser "co.uk is a public suffix โ nobody can set cookies at that level." That's the entire reason the PSL exists โ cookie safety.
6. SEO implications
Google has been consistent for years that subdomains and root domains are treated as separate sites for indexing purposes, but with an important nuance: quality signals can flow between them when they clearly belong to the same owner. Some practical takeaways:
- Subdomain vs. subfolder:
blog.example.comvsexample.com/blog. Google can rank either. Subfolders tend to consolidate authority more easily; subdomains give you infrastructure independence (different servers, CMS, subteam ownership). - Google Search Console: Each subdomain needs its own property (or use a domain property, which covers all subdomains under one registrable domain).
- Google Disavow: Uses registrable domain semantics โ
domain:example.co.ukdisavows the whole registrable, not justwww.. - hreflang & canonical: These are host-specific.
example.comandwww.example.comare separate hosts that need a canonical to unify them. - Referring domain deduplication: When you export backlinks from Ahrefs or Semrush, you almost always want to dedupe by registrable domain rather than by hostname โ otherwise 12 subpages of one bad linker looks like 12 different "referring domains".
7. When you want root vs when you want subdomain
Use registrable-only (root) mode when:
- Building a Google Disavow file
- Counting unique "referring domains" for SEO reporting
- Matching leads to company accounts in a CRM (all emails from
@sub.acme.com,@team.acme.com, etc. should map to one Acme record) - Firewall rules where you want to block/allow at the whole-company level
Keep subdomains when:
- Attack-surface mapping โ you want to know every host, not just root
- Subdomain enumeration for security recon
- CDN/infrastructure inventory (every
cdn.,static.,media.) - Debugging routing (each
api.,staging.,dev.matters)
8. Get the right answer, fast
Rather than implementing PSL logic yourself, use one of our specialised tools:
9. FAQ
www. a subdomain?www.example.com is a subdomain of example.com. In practice most sites set up a DNS record so both hosts serve the same content, plus a 301 redirect from one to the other to consolidate SEO.www.?Further reading
- How Domain Extraction Logic Works (from Text/URL/Email) โ the algorithm behind the tool.
- Build a Chrome Extension for Domain Extraction โ practical extension tutorial.
- publicsuffix.org โ the authoritative list.
- Google Search Central on subdomains vs subfolders.