How to Configure Wildcard Subdomains in cPanel
You may need to set up a wildcard subdomain, and this can be done within your cPanel account. A wildcard DNS record is a record that matches requests for non-existent domain names. A wildcard DNS record is specified by using the * symbol to create a record for the *.example.com. The most common applications for a wildcard subdomain are for use with SSL or WordPress Multisite.
How to Create a WildCard Subdomain
To create a wildcard subdomain, follow the next steps:
- Log into your cPanel.
- Navigate to Domains section > Domains menu:
3. Click the Create A New Domain button:
4. Enter the subdomain name * to add in the Domain text box:
5. Once the subdomain * is entered, the Document Root field will be set up automatically to the _wildcard_ folder:
6. Click the Submit button:
7. Go to the Zone Editor menu:
8. Make sure that there is an A record for *.yourdomain.com created and pointed to the server IP address (it could coincide with the IP address of your main domain or ftp.yourdomain.com is pointed to):
Click the “Manage” button to the right of the wildcard subdomain’s root domain
9. Now, you will need to wait until the propagation is over (it should take N seconds, where N – is TTL for this A record; you can edit it manually and reduce the number to speed up the process), and then the wildcard subdomain will work correctly.
10. Verify that the A record for the wildcard subdomain exists and points to the correct IP address.
If you have not created a WildCard Subdomain then you will not be able to ping any subdomain with the extension *.yourdomain.com
After successfully creating a WildCard Subdomain. You can ping any subdomain with the extension *.yourdomain.com it will point to the correct IP address.
Summary
Congratulations! You have now successfully set up your account for wildcard domains. You still may need to modify your .htaccess file. If you have set up wildcard subdomains for WordPress Multisite, it will automatically configure the .htaccess file for you.