How to create Wildcard subdomain
Some of the applications require dynamic subdomains, where the content delivery is managed by the application code based on the URL. Such a scenario can be handled by creating wildcard subdomain, this means any value of the subdomain accessed on the browser will route to a specific location / IP specified.
Here is how you can create a wildcard subdomain in cPanel (same can be achieved on other DNS providers if the domain is managed elsewhere).
How to create a Wildcard subdomain
- Login to cPanel
- Go to Zone Editor (DNS management incase managed elsewhere)
- Create an A record with the following
- *.yourdomain.com (use your own domain name)
- Select record type as ‘A’ record from dropdown / option
- Type in the IP where you want to route all your subdomains
If you want to know how to set an A record, check zone editor guide.