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 WordPress Multisite or 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 Domains icon under the DOMAINS section of your cPanel dashboard:
3. Click Create a New Domain in the top, right-hand corner:
4. In the Domain field, place an asterisk symbol * before the domain where you want to create a wildcard subdomain. In this case, that will look like *.laurenhanks.com. Once doing so, 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 Submit to create the new wildcard subdomain.
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.