Skip to the content
Start free

What is a subdomain?

A subdomain is a name that sits inside a larger domain name, such as shop.example.com or help.example.com inside example.com. You create it in DNS, and it can point to a different server, app or part of the business. Browsers, search engines and AI crawlers usually treat each subdomain as its own host, with its own robots.txt, its own cookies and its own crawl budget.

What is a subdomain? #

The formal rule is in RFC 1034, the standard that defines DNS: “A domain is a subdomain of another domain if it is contained within that domain.” So shop.example.com is a subdomain of example.com. Each part between the dots is a label. A label can be up to 63 octets long, and the whole name is limited to 255 octets. The subdomain is part of the domain name, which is part of the URL.

What does a subdomain look like? #

Part In https://shop.example.co.uk/shoes/ What it does
Protocol https How the browser talks to the server
Subdomain label shop Picks one host inside the domain
Registered domain example.co.uk The name you rent from a registry
Path /shoes/ A page on that host

The subdomain is set by a DNS record, usually an A record or a CNAME. See DNS for how names turn into addresses. The host also needs an SSL certificate that covers the new name, or browsers warn visitors.

Is www a subdomain? #

Yes. www.example.com is a subdomain of example.com. Most sites answer on both, so pick one and send the other to it with a 301 redirect. Google’s duplicate URL guide lists multiple hostnames as a common cause of duplicate pages. For site names, Google says subdomains starting with www or m are generally considered equivalent. See 301 vs 302 redirect and canonical tag.

Subdomain or subfolder? #

A subfolder is a path on the same host, such as example.com/shop/. Google’s guide to sites for many countries compares the two. It lists subdomains as “Easy to set up”, allowing different server locations and easy separation of sites. It lists subfolders as low maintenance on the same host, with separation harder. Google does not say one ranks better. Its SEO starter guide says: “From a business point of view, do whatever makes sense for your business.” The real difference is the work each one creates.

Job shop.example.com example.com/shop/
robots.txt Needs its own file Shares the main file
Crawl budget Separate Shared
Site name in Google Can have its own Uses the domain’s
Different server or app Easy Harder
Internal links Cross-host links to set up Normal internal links

Search engines draw the line at the host. Google’s robots.txt rules apply only to the host, protocol and port where the file sits. A file at www.example.com/robots.txt is only valid for that subdomain. Google’s crawl budget guide says its crawling infrastructure defines a site as a unique hostname, so two subdomains have separate crawl budgets. Each subdomain also needs its own robots.txt and a sensible XML sitemap.

Why does a subdomain matter for AI answers? #

An AI crawler such as GPTBot or ClaudeBot meets the same host line. If you allow AI crawlers on www but forget help.example.com, your most useful answers may never be read. The llms.txt proposal puts the file at the root path /llms.txt of a website, so a help centre on its own host needs its own llms.txt. Google also says a page must be indexed and eligible to be shown with a snippet to be a supporting link in AI Overviews or AI Mode. A blocked subdomain has no route into AI Overviews. For answer engine optimisation, check every host that holds content you want quoted.

How does Search Console see subdomains? #

Google Search Console has two kinds of property. A Domain property includes all subdomains (m, www and so on) and both http and https, and you verify it with a DNS record. A URL-prefix property only covers addresses that start with that exact prefix, so https://m.example.com/ is not in https://example.com/. If you track only the www prefix, a help centre or shop on another host is missing from your reports.

What about cookies and analytics? #

Cookies follow the host too. MDN explains that if a cookie omits the Domain attribute, it is returned only to the host that sent it. If Domain is set, subdomains are always included. Browsers also treat a different host as a different origin: store.company.com and news.company.com are not the same origin. So a visit that starts on www and ends on shop can look like two visits: the session splits, and the shop may show your own site as the referrer. Set up your analytics so every host reports into one place. See first-party cookies, cookieless analytics and cookie banners, which you need on every host that sets cookies.

Can a subdomain hurt your site? #

Yes, in three ways:

  • Spam on your name. Google’s spam policies name using existing or new subdomains to keep breaking its rules as policy circumvention. Renting a subdomain to someone else’s low-value pages can fall under site reputation abuse.
  • Takeover. MDN describes a subdomain takeover: a CNAME still points to a service you closed, and an attacker claims it and serves their own content on your name.
  • Leaks. A staging or test subdomain left open gets crawled and indexed, and creates duplicate content.

What are the common mistakes? #

  • One robots.txt on www, none on the other hosts.
  • Both example.com and www.example.com answering with a 200, with no redirect.
  • A staging host with no noindex and no login.
  • Old DNS records left pointing at closed services.
  • A sitemap on www that lists URLs from other hosts without cross-site submission. Google says sitemaps in an index must be hosted on the same site unless cross-site submission is set up.
  • No links between hosts, so the shop sits like an orphan page next to the main site.
  • Moving a blog from a subdomain into a folder without 301 redirects, so its links are lost. See moving a website without losing traffic.

A worked example #

A company runs four hosts. Here is what a check finds:

Host robots.txt Sitemap Indexable Verdict
www.example.com Yes, allows search and AI crawlers Yes Yes Healthy
example.com Copy of www No Yes, 200 not 301 Redirect to www
help.example.com None None Yes Add robots.txt, sitemap and llms.txt
staging.example.com None None Yes Add login or noindex now

The help centre holds the answers people ask AI about, yet nothing guides crawlers to it. The staging host is the bigger risk: it can be indexed as a copy of the live site.

How to check it #

  1. List every host. Start with your DNS records and your SSL certificate names. Remove any record that points at a closed service.
  2. Check robots.txt on each host. Run the Robots.txt Checker once per subdomain, not once per company. Our guide how to use the Robots.txt Checker explains the result.
  3. Check which AI crawlers each host lets in. The AI Bot Checker reads the rules for GPTBot, ClaudeBot and others. Then run the llms.txt Checker on each host that should be quoted.
  4. Check www and non-www. The Redirect Checker shows each hop. One 301 is right; a redirect chain is not.
  5. Check staging is closed. Read the status and X-Robots-Tag in the HTTP Header Checker. Then check the page tags with the Meta Tag Checker for noindex and the canonical tag.
  6. Check each sitemap. The XML Sitemap Checker shows the URLs and their hosts, so you can spot a list that mixes hosts.
  7. Check the subdomain home page. The Schema Markup Checker shows the WebSite markup Google reads for site names. The AI Readiness Checker scores how ready the host is for AI.
  8. Compare two hosts. Compare Two Websites puts www and help side by side, check by check.
  9. Check who is really crawling. Verify an AI Bot tests one address against the published lists. The Canonical Tag Checker and SSL Certificate Checker are live.
  10. Watch every host over time. Crawl budget by bot, Bot verification log and Index coverage monitor show where crawlers go and what gets indexed (in URSY Pro, opening in stages).

What URSY.com counts #

We count every request from the edge log and the origin, including pages the cache answers, and sort each one into five visitor types. Bot names are checked against the IP lists the companies publish, so a bot is marked real, fake or unknown. We keep the path, never the query string. The rules are on our methodology page.

Questions #

Do subdomains rank worse than subfolders? #

Google publishes no rule that says so. A subdomain is more work: its own robots.txt, sitemap, crawl budget and links. If you will not do that work, a subfolder is simpler.

Do I pay for a subdomain? #

No. Once you own the domain, a subdomain is just a new DNS record. You can add as many as your DNS provider allows.

Does a subdomain share the main site’s authority? #

It shares the name, not the pages. Links from the main site to the subdomain help people and crawlers find it. See internal linking and backlinks.

Do I need a new Search Console property for each subdomain? #

Not if you use a Domain property. It covers every subdomain and both protocols. A URL-prefix property covers one host only.

Should my staging subdomain be blocked in robots.txt? #

A login is safer. robots.txt stops crawling, not indexing, and Google can still index a blocked URL it finds through links. See noindex, nofollow or robots.txt.

Sources #

Updated 24 November 2026 by URSY.com.

Cite this page: What is a subdomain?. URSY. Updated 26 November 2026. https://ursy.com/wiki/subdomain/ · Section links

Tools for this

All 871 wiki entries, A to Z →