A wildcard subdomain lets one website respond to unlimited subdomain names without creating each one manually. If you are learning how to set up a wildcard subdomain in cPanel, the key is to configure both your hosting account and DNS. Creating only one of them will not make customer.yourdomain.com or anything.yourdomain.com work.
This setup is useful for membership platforms, client portals, website builders, multilingual sites, and applications that create a unique address for every user or project. It is not usually necessary for a standard business website, but it can save substantial time when your site needs to handle changing subdomains.
What a wildcard subdomain does
A normal subdomain is specific. For example, shop.yourdomain.com points visitors to one location, while support.yourdomain.com can point to another.
A wildcard subdomain uses an asterisk (*) as a catch-all. Once configured, a request for alpha.yourdomain.com, beta.yourdomain.com, or another subdomain that does not have its own record can be sent to the same website or application.
The wildcard does not create new websites or user accounts on its own. It simply directs matching requests to the document root you choose. Your application must decide what to display after the visitor arrives. For example, a client portal may read the subdomain name and load that client’s account.
A specific subdomain can still take priority over the wildcard. If you create a separate mail.yourdomain.com or shop.yourdomain.com record, that specific record is normally used instead of the wildcard. That is helpful when you need exceptions.
Before you create a wildcard subdomain
First, confirm that your domain is pointed to the correct DNS service. If your domain uses the nameservers supplied with your hosting account, you can typically manage the DNS record in cPanel. If DNS is managed by your registrar, Cloudflare, or another provider, create the DNS record there instead.
You will also need to know the destination for wildcard traffic. This is usually a folder inside your hosting account, such as public_html/wildcard, but it may be your main site folder if the wildcard should load the same application.
Be careful with an existing website. Sending every unknown subdomain to public_html can be convenient, but it also means your application needs to handle unexpected hostnames safely. A dedicated folder is often easier to test and maintain, especially for a new project.
How to set up a wildcard subdomain in cPanel
The labels in cPanel can vary slightly by version and hosting configuration. On many accounts, you will find this option under Domains. Older cPanel layouts may show a separate Subdomains tool.
1. Open the domain or subdomain tool
Log in to cPanel and open Domains. Look for an option such as Create A New Domain, Create New Domain, or Subdomains.
If your account has a separate Subdomains screen, select it and choose the domain you want to use. If you only see the Domains screen, use the new-domain option. cPanel may treat wildcard subdomains as a domain entry rather than a traditional subdomain entry.
2. Enter the wildcard name
In the domain field, enter the wildcard in the format your cPanel screen accepts:
*.yourdomain.com*as the subdomain label, withyourdomain.comselected separately
Do not enter a real word such as wildcard unless you want visitors to use wildcard.yourdomain.com. The asterisk is what tells the server to accept varying subdomain names.
Choose the document root for the wildcard. A folder such as public_html/wildcard keeps wildcard content separate from your primary site. If your application already runs in public_html and is built to recognize subdomains, you may choose that existing folder instead.
Some cPanel versions show a setting to share the document root with the main domain. Use it only when you deliberately want the same website files to answer both the main domain and wildcard requests. Otherwise, assign a separate directory and complete the setup.
3. Add the wildcard DNS record
Creating the domain entry tells the hosting server what to do after a request reaches it. DNS tells the internet where that request should go. You need both.
From the cPanel home screen, open Zone Editor. Find your domain and select Manage. Add an A record with a name like .yourdomain.com and point it to your hosting account’s IP address. In some interfaces, you enter only in the name field because cPanel automatically adds the domain.
If your host uses IPv6 and your website is configured for it, you may also add a matching AAAA record. For most shared hosting websites, the A record is the essential one.
When your DNS is hosted outside cPanel, add the wildcard A record through that provider’s dashboard. Do not create duplicate, conflicting records in different DNS systems. Only the active nameservers for your domain control what visitors see.
4. Allow time for DNS changes
DNS updates may appear within minutes, but the timing depends on the record’s TTL and cached results at networks around the internet. Plan for a few hours before assuming something is wrong. In some cases, full propagation can take up to 24 hours.
You can test with a made-up hostname, such as test123.yourdomain.com. If it loads the intended folder or application, the wildcard is working. Testing a random name is useful because it proves the catch-all rule is responding, rather than an old individual subdomain record.
Secure wildcard traffic with SSL
A wildcard DNS record does not automatically provide HTTPS protection. Browsers expect the SSL certificate to match the hostname the visitor entered.
For example, a certificate for yourdomain.com does not automatically cover client.yourdomain.com. To secure unlimited first-level subdomains, you generally need a certificate that explicitly covers *.yourdomain.com. Wildcard certificates commonly require DNS validation, and availability depends on your hosting plan and certificate provider.
Check the SSL/TLS Status area in cPanel after setting up the domain. If your free SSL service cannot issue a wildcard certificate, contact your hosting provider before sending users to HTTPS wildcard addresses. You may need a wildcard SSL certificate or a different application design that uses paths, such as yourdomain.com/client-name, instead of subdomains.
Also remember that *.yourdomain.com covers one level only. It covers client.yourdomain.com, but not portal.client.yourdomain.com.
Make sure your website can use the subdomain
At this point, DNS and cPanel can send requests to your files, but the website software still needs to respond correctly. A static HTML page will show the same content for every wildcard address. That may be exactly what you want.
Dynamic software needs additional configuration. A custom application may inspect the requested hostname and select the right customer, language, or project. WordPress Multisite can use subdomains, but it requires its own network setup and wildcard domain mapping configuration. A standard single-site WordPress installation will not automatically create separate sites just because a wildcard exists.
Avoid assuming that any incoming subdomain is valid. If visitors can choose their own subdomain names, your application should validate those names, handle unavailable accounts clearly, and avoid exposing one customer’s content to another. This is an application responsibility, not a cPanel setting.
Common wildcard subdomain problems
If wildcard addresses return a server error or the main site instead of the expected content, start with the document root. Confirm that the folder exists and contains an index file or correctly configured application files.
If the browser says the site is not secure, inspect the certificate rather than the DNS record. DNS may be correct while the certificate lacks the wildcard name.
If only some subdomains work, look for individual DNS records that override the wildcard. A specific A record, CNAME, or redirect can take precedence. Email-related names such as mail and autodiscover should be reviewed carefully before changing records, since they may support existing services.
If cPanel rejects the asterisk or does not offer a wildcard option, do not force the configuration through unrelated settings. Shared hosting configurations can differ. Ask support whether wildcard subdomains are enabled for your account and what entry format they require.
A wildcard subdomain is most useful when it supports a clear purpose, not simply because it is available. Set up the DNS, hosting destination, SSL coverage, and application behavior as one plan, and your site can handle new subdomain names without adding a new cPanel entry every time.