--- title: Subdomain description: A domain branch like blog.example.com — useful for staging, apps, or site sections without buying another domain. canonical: https://penasihathosting.com/en/hosting-wiki/subdomain type: wiki locale: en updated: 2026-07-15 author: Willya Randika --- # Subdomain ## Overview - **Summary:** A domain branch like blog.example.com — useful for staging, apps, or site sections without buying another domain. - **Author:** Willya Randika ([profile](/penulis/willya-randika)) ## Article **A subdomain** is a branch of your main domain, written as a prefix — for example `blog.example.com` or `shop.example.com`. The registrable domain stays `example.com`; the subdomain points somewhere else via [DNS](/en/hosting-wiki/dns-domain-name-system). On hosting, subdomains are common for staging, shops, APIs, docs, or internal tools without buying another domain. Technically there is almost always an A or CNAME record steering that hostname to the right server or service. ## A Simple Analogy The main domain is the building address. A subdomain is a **floor or unit number**: same building, different entrance. Visitors to `blog.` do not automatically enter the main lobby unless you configure redirects or shared content. ## Subdomain vs Addon Domain | | Subdomain | [Addon domain](/en/hosting-wiki/addon-domains) | | --- | --- | --- | | Shape | `app.example.com` | `otherbrand.com` | | New domain purchase? | No | Yes | | Document root | Usually a separate folder | Separate folder | | Best for | Staging, apps, site sections | Fully separate brands/sites | If the brand is truly separate and needs `name@otherbrand.com` mail, an addon domain is usually cleaner. If you only need a test environment or a module of the same product, a subdomain is lighter. ## Typical cPanel Flow 1. Open [cPanel](/en/hosting-wiki/cpanel) → **Domains** / **Subdomains** 2. Enter the prefix (`staging`, `blog`, `api`, …) 3. Set the [document root](/en/hosting-wiki/document-root) 4. Confirm DNS (A/CNAME) was created or point it manually 5. Issue [SSL/TLS](/en/hosting-wiki/ssl-tls) for that hostname Then upload files or install a CMS into that folder — same workflow as a normal site, different hostname. ## Healthy Usage Patterns - `staging.` or `dev.` for pre-production tests - `cdn.` or `static.` when assets are split (sometimes replaced by a real [CDN](/en/hosting-wiki/cdn)) - `mail.` is rarely a public site; mail is mostly MX records - Do not leave staging open if it holds sensitive data ## What to Watch For - SSL does **not** always cover every subdomain — check certs or wildcards - Public staging can be indexed unless you add `noindex`, basic auth, or robots rules - Subdomains share the same account limits ([EP](/en/hosting-wiki/entry-processes-ep), disk, [inodes](/en/hosting-wiki/inode)) - Bad DNS means the subdomain fails even when the folder exists in File Manager ## FAQ Creating them in DNS/hosting is usually free. You still pay for the parent domain and the hosting that stores the files. Technically yes — `www` is a hostname under the root domain. Many setups redirect www and apex so one URL is canonical. Yes. Point that hostname’s records at another IP or service while the root stays elsewhere. Common for separate apps. Plan limits matter, but resources matter more. Several CMS installs on subdomains equal several sites on one account.