1. Knowledge Base
  2. >
  3. Results
  4. >
  5. Wildcard DNS, What Is It and How Do I Use It?

Wildcard DNS, What Is It and How Do I Use It?

Wildcard DNS allows all subdomains to share the same set of files, which may be necessary for a multisite web application or if you want the subdomains to show the same content as the main site.

An example of Wildcard DNS will be if a site visitor tries to use a subdomain such as example.domain.com. It would work the same as if the visitor had gone to the designated domain, http://domain.com/.



Wildcard DNS for the Primary Domain

You can set up wildcard DNS via cPanel by following these steps:

  1. Log in to your cPanel.
  2. Navigate to the Subdomains icon in the Domains section.

    HostGator cPanel Subdomain

  3. Add a subdomain called *.

    Wildcard Subdomain

  4. Make sure to set the document root to your public_html folder.


Wildcard DNS for Addon Domains

Setting up wildcard DNS for an addon domain is mostly the same, except for the document root used.

  1. In cPanel, navigate to the Subdomains icon in the Domains section.
  2. Add a subdomain called *.
  3. Make sure to set the document root to match the document root of the addon domain. The document root can be found inside of your cPanel within the Addon Domains area.

    Document rooy

If attempting to add a wildcard subdomain for one of your addon domains, using the wrong document root will cause some issues with resolution. As always, if you have any questions, please contact our support agents, and we'll be glad to assist you with getting this set up properly.