What are wildcard subdomains?
A wildcard DNS record allows you to point all existing and non-existing subdomains to a specific area. Learn how with our easy guide!
This article explains wildcard subdomains and their intended functions.
What is a wildcard subdomain?
A wildcard DNS record allows you to point all existing and non-existing subdomains to a specific area. For example, www.example.com and test.example.com would both direct to www.example.com when a wildcard subdomain is enabled.
Note
If your main domain is example.com, then the wildcard subdomain will be *.example.com.
What function does a wildcard subdomain serve?
A wildcard subdomain is particularly useful if you desire subdomains to display whatever you set as the document root (a designated folder that stores web pages.) Typically, most wildcards are set to the site’s homepage out of preference. This should be specified when creating the wildcard subdomain. cPanel does not set the site’s homepage as the default but instead utilizes wildcard.domain as the de facto root of the wildcard. WordPress and other CMS often respond unpredictably when accessed via a URL other than what is in their setup, so it is important to use caution when configuring the domain.
Wildcard domains are particularly useful for some multisite web applications that require the use of wildcard subdomains, as well as avoiding propagation delays. When utilizing wildcard domains to avoid propagation delays, the wildcard is set directly in DNS with no document root. Any added subdomains will then resolve immediately.
How do you set up a wildcard subdomain?
For information about how to set up a wildcard subdomain, please see this article. Essentially, it’s as easy as placing "*" in the right text field while configuring a domain in cPanel.
Having issues setting up your wildcard subdomain?
If you’re having issues with configuring your wildcard subdomain, there are a wealth of resources to consult. Our Knowledge Base offers a wide variety of articles on domains. Alternatively, open a support ticket at https://my.hosting.com.
Related Articles
Updated 3 days ago