Setting Up CNAME Records for Subdomains
Setting Up CNAME Records for Subdomains
A CNAME (Canonical Name) record maps one domain name to another. It is commonly used to point a subdomain to a third-party service, such as shop.yourdomain.com pointing to your Shopify store, or mail.yourdomain.com pointing to Google Workspace.
When to Use a CNAME Record
- Pointing a subdomain to an external service (Shopify, Squarespace, HubSpot, etc.)
- Creating a
wwwalias that points to the root domain - Verifying domain ownership with a third-party service
Adding a CNAME Record in KPanel
- Log in to KPanel at kpanel.kapsulecloud.com
- Go to Domains and select your domain
- Click DNS Records
- Click Add Record
- Set the type to CNAME
- Enter the subdomain in the Name field (for example,
shopforshop.yourdomain.com) - Enter the target domain in the Value field (for example,
shops.myshopify.com) - Click Save
CNAME vs A Record
| Use Case | Record Type |
|---|---|
| Pointing to an IP address | A record |
| Pointing to another domain name | CNAME |
If a third-party service gives you an IP address, use an A record. If they give you a domain name, use a CNAME.
The www Subdomain
Many websites point www.yourdomain.com to the same place as yourdomain.com. This can be done with a CNAME:
| Type | Name | Value |
|---|---|---|
| CNAME | www | yourdomain.com |
When you add a domain to a website in KPanel, the www CNAME is created automatically. You only need to add it manually if you are managing DNS at an external provider.
CNAME Restrictions
There are a few technical limitations to be aware of:
- You cannot use a CNAME for the root domain (the bare
@oryourdomain.com). Use an A record for this. - You cannot have a CNAME alongside other record types (such as MX or TXT) for the same name.
Checking Propagation
After adding a CNAME, it can take up to a few hours to propagate worldwide. To check the current value, visit dnschecker.org, enter your subdomain, and select CNAME as the record type.
