Skip to content
Domains and DNS4 min read

How to create a subdomain like blog.example.com

Short answer

To create a subdomain, open cPanel » Domains » Domains and click Create A New Domain, enter the full name such as blog.example.com, untick the option to share the main document root so it gets its own folder, and click Submit. If the domain uses your host's nameservers, the DNS record is added automatically and a free SSL certificate follows.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. Common uses
  2. Before you start
  3. Steps: a subdomain with its own site
  4. Changing or removing a subdomain
  5. A subdomain that points to an external service
  6. Troubleshooting
  7. On ArabyHost

A subdomain is a name in front of your main domain, such as blog.example.com or shop.example.com. It can serve a separate site with its own files on the same hosting, or point to an external service such as a store platform or help desk. Creating one costs nothing; what matters is picking the right folder and making sure the DNS record and SSL certificate are in place.

Common uses

Subdomain Use How to set it up
blog.example.com A separate WordPress blog Subdomain on your hosting with its own folder
staging.example.com A test copy for trying changes Subdomain on your hosting
app.example.com An app or dashboard Subdomain on your hosting
shop.example.com A store on an external platform A CNAME record only

Before you start

  • The main domain is added to your hosting account.
  • Access to cPanel, which opens with one click from your hosting panel.
  • Know where DNS is managed: if the domain uses your host’s nameservers the record is created automatically; if DNS is with another provider such as Cloudflare, you add it yourself.
  • The server’s IP address if DNS is elsewhere. It’s on your service page, or in cPanel under General Information as Shared IP Address.

Steps: a subdomain with its own site

1. Open the Domains page in cPanel

Go to cPanel » Domains » Domains and click Create A New Domain. Older cPanel versions have a separate Subdomains page with similar fields.

2. Enter the full name

Type blog.example.com in the Domain field. Use lowercase letters, digits and hyphens only.

3. Give it its own folder

Untick Share document root (/home/username/public_html) with example.com; a Document Root field appears with a suggestion such as blog.example.com. Keeping the folder outside public_html is better, because a folder inside it also makes the files reachable at example.com/blog.

4. Click Submit

cPanel creates the folder and adds the DNS record if the domain uses the host’s nameservers.

5. Check the DNS record

dig blog.example.com +short

It should return the server’s IP address; you can also check with the DNS lookup tool. If DNS is with another provider, add one of these:

blog    A       203.0.113.10
blog    CNAME   example.com.

Replace the address with your server’s.

6. Get the SSL certificate

AutoSSL issues the certificate automatically on its next run once the subdomain points to the server. To speed it up, open cPanel » Security » SSL/TLS Status, make sure the subdomain is selected and click Run AutoSSL. If the record goes through the Cloudflare proxy, see using Cloudflare with your hosting.

7. Upload files or install an app

Upload the site’s files to the subdomain’s folder with the File Manager, or install WordPress and pick the subdomain from the installer’s domain list.

Changing or removing a subdomain

In cPanel » Domains » Domains, click Manage next to the subdomain. From there you can change its folder (Document Root) or delete it with Remove Domain. Removing it doesn’t delete its files or any databases it used, so clean those up yourself if you no longer need them, and delete the DNS record too if it lives with another provider, so the name doesn’t keep pointing at an empty site.

A subdomain that points to an external service

If a service gives you a CNAME record, such as a store platform or help desk, don’t create the subdomain on the Domains page. Open cPanel » Domains » Zone Editor, click Manage next to the domain, then Add Record, choose CNAME, and enter the name (for example shop) and the value the service gives you. Creating a hosting subdomain with the same name adds an A record that conflicts with the CNAME. A worked example is in connecting a domain to a Salla store.

Troubleshooting

  • The main site opens instead of the subdomain: the shared document root option was ticked, or the files went into public_html instead of the subdomain’s folder.
  • DNS_PROBE_FINISHED_NXDOMAIN: there’s no DNS record for the subdomain because DNS is with another provider, or it’s still propagating. See the error explained.
  • “Not secure” warning: AutoSSL hasn’t run for the subdomain yet. Run it manually, and if you have a CAA record, make sure it allows the issuing authority.
  • A 403 page or a file listing: the folder is empty or has no index.php or index.html.
  • “Record already exists”: a record with the same name is in Zone Editor. Delete it and try again.
  • www.blog.example.com doesn’t work: that’s a different name needing its own record, and you rarely need it.

On ArabyHost

Open cPanel with one click from the Araby Panel and create subdomains from the Domains page. If the domain uses ns1.arabicode.com and ns2.arabicode.com, the DNS record is added automatically, AutoSSL issues a free certificate for the subdomain, and it’s included in the daily backups. You can install WordPress on a subdomain in one click, and on AI/Developer plans you can run a Node.js or Python app on it through the CloudLinux selectors. Keep in mind that subdomains share the same account’s resources and limits.

FAQ

Do I need to buy a new domain to create a subdomain?

No. A subdomain is part of the domain you already own, so you can create blog, shop or anything else with no extra registration fee. The main domain just needs to be on your hosting, or you need control of its DNS.

Does a subdomain need its own SSL certificate?

It needs to be covered by one. On cPanel hosting, AutoSSL issues a free certificate for the subdomain automatically once it points to the server, and you can speed that up with Run AutoSSL in SSL/TLS Status.

Is a subdomain or a subfolder better for SEO?

Google indexes both, but a subfolder such as example.com/blog keeps content under one site and is easier to manage. A subdomain makes more sense for a technically separate app or an external service.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.