Vezi pagina în română

IT Glossary

What is a subdomain?

A name added in front of the main domain and separated by a dot, as in blog.example.com, that can host a separate site or application without a new domain.

6
sections
6
questions answered

A subdomain is a domain contained within a larger domain: a name added in front of the main domain and separated by a dot, as in blog.example.com or shop.example.com within example.com. In the DNS standard (RFC 1034, 1987), every name is a subdomain of the name to its right, so example.com is itself a subdomain of .com; each part between dots may be at most 63 characters and the whole name at most 255. The same rule runs Romanian public-sector addresses: abc.gov.ro is a subdomain of gov.ro and is recorded in the GOV.RO registry (domenii.gov.ro).

For a business the value is practical: a subdomain is not bought but created with a DNS record, and it can point to another server or another provider. That is how a shop, a customer application or a test copy can run apart from the main site. The choice between a subdomain and a subfolder (example.com/blog) is made once, at the start of a project: content meant to support the main site belongs in a subfolder, and a separate system gets a subdomain.

Why it matters for your business

Different systems under one brand

Shop, blog, application and client portal can run on separate platforms and servers while all carrying addresses built on the company name — coherent and easy to remember.

One system down does not stop the main site

A problem in the application at its own address does not take down the main site; maintenance, updates and access are administered entirely independently.

New addresses at zero cost

Subdomains are created free in minutes from DNS management, which makes them useful for campaigns, test versions and internal tools as much as for major sections.

How a subdomain works in DNS

The DNS standard defines the relationship simply: a domain is a subdomain of another domain if it is contained within that domain (RFC 1034, section 3.1). So A.B.C.D is a subdomain of B.C.D, of C.D and of D. DNS turns the name into the address of a server, and each subdomain has its own records.

An A or AAAA record points the subdomain at an IP address; a CNAME record points it at another name, for instance the address a shop platform gives you. A subdomain can also be delegated, through NS records, to other name servers so that another team or provider manages it (RFC 1034, section 4.2). It is created from the hosting panel (in cPanel, the Domains section) or from the DNS zone at the registrar or DNS provider, and the change becomes active within minutes or hours, depending on the TTL.

Examples of subdomains

www is the oldest subdomain and the most widespread convention; for site names, Google treats www and m as equivalent to the root domain. Other common uses: mail or webmail for email, blog for a blog on another platform, shop for an online shop (often a CNAME to the shop platform), app or account for a customer portal, and test or staging for a verification copy, protected by a password, not only by noindex.

Language versions use the same mechanism: ro.wikipedia.org is a subdomain of wikipedia.org. In the Romanian public sector, abc.gov.ro is registered through the online form on domenii.gov.ro, and a further-level subdomain, xyz.abc.gov.ro, is created by the holder of abc.gov.ro, who must report it to the GOV.RO registry within 5 days of the request.

Want an estimate for your project?

Message us on WhatsApp. We reply the same working day, and the first 30-minute call is free.

Book a free call

Subdomain or subfolder: what Google says

For site diversity (Google generally shows no more than two listings from the same site in its top results), the ranking systems guide says subdomains are generally treated as part of the root domain: subdomain.example.com and example.com count as one site; sometimes, when its systems deem it relevant, subdomains are treated as separate sites. Site names and favicons are set per hostname: a subdomain can appear in results with its own name and icon, whereas a subfolder takes those of the main site.

In Search Console, a Domain property, verified through a DNS record, includes all subdomains, while a URL-prefix property includes only its own prefix. Google's documentation does not say that either option ranks better.

What follows is a rule of practice, not a Google rule: one site, one property and one set of links are simpler to run. Blog, guides and resources therefore go in a subfolder (example.com/blog). A subdomain is the choice when the section is a different system: a shop platform, an application, a portal, another country or another audience.

What to check when adding a subdomain

The certificate. The subdomain must be covered by an SSL certificate. A wildcard *.example.com covers blog.example.com but not test.blog.example.com, nor example.com itself, because a wildcard matches a single label, the left-most one (RFC 9525, section 6.3).

Cookies. A cookie set with Domain=example.com is sent to every subdomain (RFC 6265, section 4.1.2.3); without the Domain attribute it stays on the host that set it. So do not put content or applications you do not control, such as a third-party platform or user uploads, on a subdomain of a domain whose login cookies are shared.

Subdomain takeover. If the DNS record (usually a CNAME) stays after the service behind it is closed, someone else can claim the name at the same provider and publish under your subdomain (MDN, "Subdomain takeover"). When you close a service, delete the DNS record first, and keep a list of your subdomains and where each one points.

Frequently asked questions

Subdomain or subfolder — which is better for search?

For content whose job is to support the main site (blog, guides, resources), the subfolder example.com/blog is the safe choice: everything stays one site for Google, with the same links and one property in Search Console. A subdomain earns its place when the section is a different system: a shop on another platform, an application, a portal for another country or audience.

How is a subdomain created?

From the hosting panel (in cPanel, the Domains section) or the DNS zone, you add an A or CNAME record carrying the name you want and pointing at the server where the content runs. It takes minutes plus DNS propagation. The subdomain needs its own certificate or a wildcard *.example.com, which covers one level only (blog.example.com, not test.blog.example.com).

Is www itself a subdomain?

Technically yes: www is the most widespread subdomain, a convention left over from the early web, and Google treats it as equivalent to the root domain for site names. The site should work at both forms, with one chosen as official and the other permanently redirected (301) to it; otherwise a search engine can see two parallel sites with identical content.

Does a subdomain have to be bought separately?

No. Whoever holds example.com can create any number of subdomains with DNS records, with no registration fee. You pay, if at all, only for where their content runs: the hosting or platform used by the shop, the application or the customer portal.

How many levels can a subdomain have?

The DNS standard (RFC 1034) allows at most 63 characters per part and 255 for the whole name, so in theory over a hundred levels. In practice one or two are used, as in shop.example.com and test.shop.example.com, because every extra level complicates certificates and cookies.

Can someone take over a company's subdomain?

Yes, if a DNS record still points at a closed service: a shop, a landing-page tool, a cloud application. Someone opens an account at that provider under the same name and publishes at your address. Prevention: delete the record when you close the service and review the DNS list periodically.