A wildcard subdomain (e.g., *.yourdomain.com) matches any subdomain that has not been explicitly created, such as blog.yourdomain.com, shop.yourdomain.com, or anything else. This is commonly used for multi-tenant applications, staging environments, or catch-all setups.
This guide walks you through creating a wildcard subdomain in cPanel.
Step 1: Log in to cPanel
Log in to your cPanel account using your credentials.
Step 2: Create the wildcard subdomain
Navigate to Domains → Subdomains.
- In the Subdomain field, enter
*(the asterisk character). - Select your domain from the Domain drop-down list.
- The Document Root will auto-populate (e.g.,
public_html/*). You may change this path if needed. - Click Create.
Step 3: Verify the A record
Navigate to Domains → Advanced DNS Zone Editor and select your domain.
Confirm that an A record for * exists and points to your server's IP address. cPanel usually creates this automatically in Step 2, but it is important to verify.
- Name:
* - Type:
A - Address: Your server's IP address
If the record is missing, add it manually and click Add Record.
Step 4: Wait for DNS propagation
DNS changes can take up to 24–48 hours to propagate globally. Once complete, any subdomain not explicitly defined will resolve to your wildcard subdomain's document root.
Important Notes
- Wildcard subdomains only match one level deep.
blog.yourdomain.comwill match, butsub.blog.yourdomain.comwill not unless you create a separate wildcard for the second level. - If you have existing subdomains (e.g.,
mail.yourdomain.com), they will continue to work as defined — the wildcard only catches undefined subdomains. - Your server or application must be configured to handle incoming requests for arbitrary subdomains. A wildcard DNS record alone does not serve content — your web server (Apache/Nginx) or application must process the requests.
- If your domain uses external nameservers (e.g., Cloudflare), you must add the wildcard A record on that platform as well.
Troubleshooting
- Wildcard subdomain not resolving? Use WhatsMyDNS to check if the A record has propagated. Also verify the record exists in the DNS Zone Editor.
- Server default page shown? Your web server may not be configured to handle the wildcard subdomain. Check your Apache/Nginx virtual host configuration or contact your hosting provider.
- "Subdomain already exists" error? A
*subdomain may already be configured. Check the Subdomains list and the DNS Zone Editor for existing wildcard entries. - SSL certificate issues? Wildcard SSL certificates (e.g.,
*.yourdomain.com) are required for HTTPS on wildcard subdomains. Check if your hosting provider's AutoSSL supports wildcard certificates.