Skip to main content

subdomains

Subdomain Naming Rules for Public Projects

Choose a public hostname with a purpose-owner-lifecycle worksheet, a practical naming rubric, and an expiry plan for previews and temporary environments.

Published
Updated
Reviewed

Source review: Checked against RFC 1035 label rules, the RFC 1123 hostname syntax update, and current Google guidance for descriptive URL structures.

A public hostname becomes a promise. docs.example.com suggests documentation, status.example.com suggests trustworthy service health, and login.example.com suggests an authentication boundary. The DNS record may take seconds to create, but the expectation created by the name can last for years.

Choose the label only after the audience, owner, destination, and lifetime are known. That order prevents a temporary deployment nickname from becoming a permanent public contract.

Start with the technical boundary

For conventional Internet hostnames, use ASCII letters, digits, and hyphens. A label must begin and end with a letter or digit; RFC 1123 relaxed the older rule so a leading digit is valid. DNS label comparison is case-insensitive, and an individual label is limited to 63 octets.

Those are protocol limits, not naming targets. A public label that uses all 63 characters may be valid and still be difficult to read, dictate, log, or fit into certificates and dashboards. Prefer the shortest label that remains unambiguous.

clear and durable        docs.example.com
clear and scoped         api-eu.example.com
temporary by design      pr-482.preview.example.com
hard to own later        final-new-prod-2.example.com
authority-confusing      secure-account-support.example.com

If a DNS provider, hosting platform, or subdomain program applies a stricter length or reserved-name rule, the stricter rule wins.

Complete the purpose-owner-lifecycle worksheet

Do not approve a name from the label alone. Record the operating facts beside it:

Requested hostname:
Public purpose:
Primary audience:
Service owner:
Destination platform or origin:
Authentication required: yes / no
Search visibility: index / noindex / private
Lifecycle: permanent / release-scoped / temporary
Review or expiry date:
Replacement or redirect plan:
Abuse and incident contact:

The worksheet catches two expensive gaps early:

  • No owner: nobody can fix a certificate, remove a stale route, or answer an abuse report.
  • No lifecycle: a preview hostname remains public because no event says when it should end.

If the destination record type and HTTPS plan are not known yet, pause naming and work through the subdomain setup sequence first.

Score the name before publishing it

Use a small rubric to make trade-offs visible. Score each dimension from 0 to 2; any zero is a reason to revise, even if the total looks acceptable.

Dimension012
Purpose clarityMisleading or opaqueUnderstandable only with team contextA visitor can predict the surface
Authority fitImplies authority the service does not haveBroad label with a real ownerScope and authority match
DurabilityTied to today’s deployment nicknameLikely to need renamingStill useful after platform changes
Collision riskConflicts with infrastructure or another teamSimilar to an existing labelNamespace owner confirms it is distinct
LifecycleNo owner or end stateOwner exists but cleanup is manualOwner, review date, and retirement action are recorded

Example:

CandidateClarityAuthorityDurabilityCollisionLifecycleDecision
docs.example.com22222Publish for the canonical docs site
status.example.com20221Reject until a real status process and owner exist
pr-482.preview.example.com22122Publish with automated expiry
new-prod.example.com01010Rename before creating DNS

The numbers are an internal decision aid, not a universal ranking signal. The written reason and accountable owner matter more than the sum.

Treat authority-bearing labels as reserved by default

Some labels carry security or organizational meaning:

  • login, auth, account, and secure imply identity handling
  • billing, pay, and checkout imply financial actions
  • status implies current, maintained incident information
  • support and help imply an active response channel
  • admin, internal, vpn, and sso imply privileged access
  • vendor and product trademarks imply an official relationship

Reserve these labels until the named function exists, the responsible team accepts ownership, and the page delivers what the label promises. A static placeholder at status.example.com is worse than having no status hostname because it creates false confidence during an incident.

For multi-team domains, maintain a namespace registry with reserved infrastructure labels, delegated prefixes, and contacts. DNS can technically contain overlapping ideas such as docs, developer-docs, and help-docs; the registry prevents that ambiguity from reaching users.

Separate permanent surfaces from temporary environments

Permanent names describe a stable visitor purpose:

docs.example.com
api.example.com
handbook.example.com
status.example.com

Temporary names should encode both scope and cleanup mechanics:

pr-482.preview.example.com
release-2026-07.preview.example.com
client-a.review.example.com

Avoid labels such as test, temp, or new without an identifier and expiry. They say that the surface is temporary but provide no way to determine which deployment owns it or when it can be removed.

A useful temporary-host policy includes:

  1. a predictable prefix such as preview.example.com
  2. an owner derived from the deployment or repository
  3. authentication or noindex when the surface should not be discoverable
  4. deletion after merge, release, or a fixed retention window
  5. a final 404 or 410 state when an exposed URL is retired

If a wildcard will route these environments, read the wildcard DNS and TLS guide before assuming one record or certificate covers every depth.

Illustrative naming worksheet

The image below shows a compact way to keep purpose, owner, and expiry beside a proposed hostname. It is not a capture from a live request system.

Illustrative worksheet for evaluating a public subdomain name, owner, audience, and expiry

Illustrative example using reserved example domains and IPs.

Validate the expectation, not only the syntax

Before launch, ask three different questions.

Does DNS contain the intended name?

dig docs.example.com A +short
dig docs.example.com AAAA +short
dig docs.example.com CNAME +short

Record which answer is expected. Empty output for one type is not automatically a failure when another type is the actual contract.

Does the destination accept the hostname?

curl -I https://docs.example.com

Confirm valid TLS, the correct application, and the intended redirect. A correct DNS answer that reaches a default hosting page is not a successful launch.

Does the name communicate the right job?

Ask someone outside the implementation team what they expect to find at the hostname. If the answer differs from the intended surface, revise the name before links, callbacks, and bookmarks make it expensive.

Google’s URL guidance concerns full URLs rather than DNS governance, but the same user-facing principle is useful here: readable, descriptive words are easier to understand than opaque identifiers. Keep unavoidable build IDs in a controlled preview namespace instead of using them for permanent product surfaces.

Record the decision and the exit

The final naming record should contain:

  • the approved hostname and plain-language purpose
  • the DNS and application owners
  • the expected record type and target
  • whether the surface is public, noindex, or authenticated
  • the certificate strategy
  • the creation date and next review or expiry date
  • the redirect, 404, or 410 action when the name is retired

Feed those records into a recurring public subdomain inventory and cleanup runbook. A durable naming system is not one that never changes; it is one where every public name has an owner, a clear promise, and a documented way to end.

Sources and further reading

Vendor behavior can change. Use these primary sources to confirm the current product-specific details.

Continue learning

  1. 01
    Subdomain Setup: DNS, Routing, and HTTPS

    Plan a subdomain as a complete public endpoint: choose the record, prepare host routing, account for DNS caches, and verify TLS and application behavior.

    Read
  2. 02
    Cloudflare DNS: Records, Proxy Status, and Verification

    Configure a Cloudflare DNS record with an explicit target, proxy decision, accurate TTL expectations, and checks for both DNS and the public application path.

    Read
  3. 03
    Wildcard Subdomains: When to Use Them

    Design wildcard DNS without confusing DNS reachability, application host routing, and the one-label coverage of TLS wildcard certificates.

    Read