Wildcard Domains

March 30, 2026 16 views

Wildcard Domains

A wildcard domain (*.example.com) catches all subdomains that are not explicitly defined. If someone visits anything.example.com and that subdomain has no dedicated record, the request is handled by the wildcard rule.

When to use wildcard domains

  • Multi-tenant applications – each customer has their own subdomain (e.g., company1.example.com, company2.example.com)
  • Dynamic subdomains – subdomains generated by the application at runtime
  • Catch-all landing pages – capturing any non-existent subdomains

Enabling wildcard domains

  1. Log in to the user panel
  2. Go to your domain settings
  3. Toggle Wildcard Enabled on

DNS setup

Add the following to your domain's DNS records:

*.example.com    A    SERVER_IP_ADDRESS

Alternatively, you can use a CNAME record:

*.example.com    CNAME    example.com

SSL certificate for wildcard

For wildcard domains, you need a wildcard SSL certificate (*.example.com). You can request this certificate from the SSL Certificates page in the panel. A wildcard certificate covers all first-level subdomains.

Application-level handling

Your application must handle routing based on the subdomain. For example:

// PHP – detecting the current subdomain
$host = $_SERVER['HTTP_HOST'];
$subdomain = explode('.', $host)[0];

Laravel – subdomain routing

Route::domain('{tenant}.example.com')
    ->group(function () {
        Route::get('/', function ($tenant) {
            // Logic for specific tenant
        });
    });

Framework compatibility

  • Laravel – native support via subdomain routing
  • WordPress – multisite mode with subdomain mapping
  • Other frameworks – handling via the HTTP_HOST header

Important note

A wildcard domain only catches subdomains that do not have their own explicit DNS record. If you have a defined subdomain blog.example.com, it will take priority over the wildcard rule.

Was this article helpful?

Your feedback helps us improve our documentation

Still need help?

If this article didn't answer your question, our support team is here to help.

Contact Support