Wildcard subdomains are crucial for dynamic setups like multisite environments, allowing you to handle all potential subdomains with a single DNS entry. In this guide, we'll show you how to properly create and configure wildcard subdomains using cPanel.
Pre-requirements
- Access to your cPanel account with DNS management privileges.
- The domain must be properly configured and pointed to your hosting provider.
- A basic understanding of DNS records and subdomains.
What is a Wildcard Subdomain?
A wildcard subdomain allows you to match requests for any subdomain that doesn't already exist. It is particularly useful for applications like WordPress multisite networks or dynamic content setups where subdomains are created on demand.
For example, with a wildcard subdomain, anything.yourdomain.com can point to a specific folder without needing to set up each subdomain manually.
Steps to Create a Wildcard Subdomain in cPanel
- Log in to your cPanel account.
- Go to the Domains section and open the Domains interface.
- Click the Create A New Domain button.
- In the Domain text box, enter your wildcard subdomain in the format: *.yourdomain.com.
- In the Document Root (File System Location) text box, specify the folder where the wildcard subdomain’s files should be located (e.g.,
/public_html/yourwildcardfolder
). - Click the Submit button to complete the creation of the wildcard subdomain.
- Next, return to the main cPanel page by clicking the Tools icon.
- In the Domains section, open the Zone Editor interface.
- Click the Manage button next to your root domain (e.g., yourdomain.com).
- Verify that an A Record for *.yourdomain.com exists and points to the correct IP address of your server.
Enabling Zone Editor Features
To ensure full functionality, verify that the Zone Editor (AAAA, CAA, DMARC, SRV, TXT) feature is enabled for your cPanel account. If this feature is not enabled, follow the documentation for your hosting provider to enable advanced DNS management tools.
Additional Notes
- DNS changes, including the creation of wildcard subdomains, may take up to 48 hours to propagate globally.
- If your root domain's DNS is managed externally (e.g., through a different provider), you will need to manually add the wildcard subdomain’s A record to the appropriate DNS zone on the external server.
- When using Cloudflare, ensure that you do not proxy mail-related DNS records, including wildcard subdomains, through Cloudflare.
Common Issues and Troubleshooting
- If your wildcard subdomain is not resolving after setup, check your A record to confirm it points to the correct IP address.
- If using a content management system (CMS) like WordPress, ensure that your CMS is properly configured to handle wildcard subdomains (e.g., WordPress Multisite).
- If your wildcard subdomain is not functioning as expected, visit MXToolbox to verify your DNS records and check for potential issues.
By following this guide, you will be able to successfully create and configure a wildcard subdomain using cPanel. Whether you're managing dynamic subdomains for applications or setting up a multisite network, wildcard DNS records are a powerful tool to streamline your domain management.
Need more help? Contact our support team or check out this additional resource for further information.