Wildcard Subdomains allow you to point all the subdomains (existing and non-existing) of a root domain to a specific file or folder in your cPanel account. Wildcard subdomains can be particularly useful in the following scenarios:
- if you would like a "catch all" solution that directs all subdomains to the main website
- if you need to point DNS and/or set up SSL certificates for a multisite web application
For example, www.sample-domain.com and blog.sample-domain.com can both direct to sample-domain.com when a wildcard subdomain is enabled.
A wildcard subdomain is specified by using an asterisk * as part of the domain name:
*.sample-domain.com
Creating a Wildcard Subdomain
2. Navigate to Subdomains under the DOMAINS section of your cPanel dashboard:
3. In the Subdomain field, place an asterisk * symbol which will signify that you are creating a wildcard subdomain. In the following field, choose the domain that you want to work with. Once selecting the domain, the file path will be automatically specified in the Document Root field. However, this can always be changed if needed, depending on where you want to point traffic.
4. Click Create to save your changes.
That's it! You will then see a success message to confirm the subdomain was set up. Please allow a couple of hours for the new subdomain to propagate throughout the Internet.
Working with Wildcard Records
In the DNS Zone Editor you can find the automatically created DNS record for your wildcard subdomain. Here you can modify the A record pointing to the server your site or application is hosted on.
Installing an SSL Certificate for wildcard subdomains is straight forward and can be done through Let's Encrypt. We have the process outlined in a separate guide.
Please feel free to contact us if you have any questions or need further assistance.