A wildcard subdomain lets any subdomain of your domain, even ones you haven't specifically created, automatically point to the same website or application. Instead of creating shop.yourdomain.com, blog.yourdomain.com, and every other combination one by one, a single wildcard entry (written as *.yourdomain.com) catches all of them at once.
When You'd Use a Wildcard Subdomain
- Multi-tenant apps where each customer gets their own subdomain, for example clientname.yourdomain.com
- Catching unexpected or mistyped subdomain requests so they land on your main site instead of showing an error
- Testing or staging setups where you want any subdomain to resolve without adding a DNS record each time
If you already have specific subdomains set up, such as mail.yourdomain.com or shop.yourdomain.com, those explicit entries still take priority over the wildcard. The wildcard only catches subdomains that don't already have their own record.
Creating a Wildcard Subdomain
In cPanel
- Log in to your cPanel account.
- Under the Domains section, click Subdomains.
- In the Subdomain field, type an asterisk: *
- Confirm the correct domain is selected in the dropdown next to it.
- Leave the Document Root as suggested, or point it to a specific folder if you want the wildcard to serve different content than your main site.
- Click Create.
cPanel creates the subdomain as *.yourdomain.com and adds the matching DNS record automatically.
In DirectAdmin
- Log in to your DirectAdmin account.
- Go to Domain Setup (labelled Subdomain Management in some themes).
- Click Add Subdomain.
- In the subdomain name field, enter an asterisk: *
- Choose the document root for the wildcard, or accept the default.
- Click Create.
DirectAdmin adds the matching * record to your domain's DNS zone.
Pointing the Wildcard Somewhere Specific
By default, a wildcard subdomain usually serves the same content as your main domain. If you're running an application that needs to behave differently depending on which subdomain was visited, for example showing a different customer's account, that logic lives in your application code, not in the control panel. The wildcard's job is simply to make sure the request reaches your server instead of failing with a DNS error.
DNS changes, including new wildcard records, can take a few hours to propagate fully. If anything.yourdomain.com doesn't resolve right away, give it some time before troubleshooting further.
If you only need a handful of subdomains rather than an open-ended wildcard, it's usually simpler to create each subdomain individually.