Domains and DNS

Set up wildcard subdomains and check their scope

Reviewed on 2 min read subdominios wildcard

A wildcard subdomain uses an asterisk to handle names you haven't added one by one, for example *.example.com. It can be useful for an application that manages its own subdomains. Three things need to fit together: public DNS, the hosting configuration and the application.

Set it up

  1. Open cPanel > Domains > Create a New Domain. If a type selector appears, use the one for your own or registered domain.
  2. Enter *.example.com, replacing the domain with yours.
  3. Choose whether it will share the main domain's root or have its own folder, and save.
  4. Check the * record in the authoritative DNS zone. If DNS is managed elsewhere, the change has to be made there.

Don't add another wildcard without checking whether one already exists: it may have a destination another application needs. Names with explicit records need their own review and may follow a different destination.

Application and HTTPS

Reaching the same folder doesn't automatically create a site inside WordPress Multisite or another application. Set up the allowed names and test both a known name and a new one.

For HTTPS, check the certificate's coverage. *.example.com covers names such as tienda.example.com, but not the root domain example.com or a.tienda.example.com. Don't assume AutoSSL can issue the wildcard with any DNS provider: its validation depends on the integration available.

Check and remove

Test a new name over HTTP and HTTPS, as well as a subdomain that already had its own records. Check which content responds and whether the certificate matches the name requested.

If you only need a few names, creating them explicitly makes them easier to control. To remove the wildcard, first check which applications use it, then remove the web configuration and the corresponding DNS record separately.

You may also find useful

Something wrong or out of date? Tell us and we will review it.