Domains

How to Configure a Wildcard Domain in DNS

A wildcard DNS record lets you route every possible subdomain to the same server with just one DNS entry.

From below of fiber optic switch with sockets and connected rubber cables on blurred background

A wildcard DNS record covers every possible subdomain of your domain with a single entry. Once you set up *.yourdomain.com, requests to shop.yourdomain.com, blog.yourdomain.com, or even xyz.yourdomain.com all land on the same server — no manual record needed for each one.

When do you need a wildcard domain?

The most common use case is multi-tenant platforms: each customer gets their own subdomain (client1.yourapp.com, client2.yourapp.com) without any extra DNS work every time a new account is created.

Other popular scenarios:

  • Dynamic staging environments: temporary subdomains for code branches (feature-checkout.yourdomain.com).
  • Region or language stores: mx.store.com, us.store.com, and so on.
  • SaaS dashboards: every tenant gets a branded URL automatically.
  • Defensive registration: block rogue subdomains pointing elsewhere by claiming all of them at once.

Which DNS record type to use

A wildcard is configured exactly like any normal subdomain — only the name field changes:

Type Name (host) Value Use when
A * Server IP (e.g. 203.0.113.10) Fixed-IP server
CNAME * Target hostname (e.g. yourserver.example.com) Cloud platform / dynamic IP
AAAA * IPv6 address IPv6-enabled server

Rule of thumb: if your server has a fixed IP, use an A record. If you're pointing to a platform like AWS, Vercel, or Cloudflare, use a CNAME.

Important: the wildcard does not cover the root domain (yourdomain.com) or subdomains that already have an explicit record. An explicit record always wins over the wildcard.

How to add a wildcard DNS record (step by step)

The process is nearly identical across all control panels — cPanel, Cloudflare, Namecheap, GoDaddy. Only the UI labels differ.

1. Open your domain's DNS zone

Log in to your registrar or hosting provider. Find the DNS, DNS Zone, or Manage DNS section.

2. Create a new record

Click Add record and fill in the fields:

  • Type: A (or CNAME if applicable)
  • Name / Host: * (just the asterisk)
  • Value / Target: your server's IP or the destination hostname
  • TTL: 3,600 seconds is fine to start; drop to 300 while testing

3. Save and wait for propagation

DNS changes take anywhere from 5 minutes to 48 hours to propagate worldwide, though in practice it's usually under an hour. You can check progress with online DNS diagnostic tools or from the terminal:

dig any-subdomain.yourdomain.com

When the response shows your IP, the record is live.

SSL certificates for wildcard domains

A standard DV SSL certificate covers yourdomain.com and www.yourdomain.com, but not additional subdomains. To protect *.yourdomain.com you need a wildcard SSL certificate.

  • Let's Encrypt / Certbot: issues free wildcard certificates, but validation requires a DNS challenge (not HTTP). You'll need API access to your DNS provider.
  • Cloudflare: if you delegate DNS to Cloudflare, the free plan includes automatic wildcard SSL for proxied subdomains.
  • Paid certificates: providers like DigiCert or Sectigo offer wildcard DV certificates from around $70 USD/year with simpler validation.

Common mistakes when configuring a wildcard

  • Typing *. instead of *: some panels add the dot automatically. Check how the final record looks in your interface.
  • Forgetting the web server: the wildcard DNS gets traffic to the server, but the server itself must be configured to accept any subdomain (Apache ServerAlias *, or Nginx server_name ~^(.+)\.yourdomain\.com$).
  • Expecting two-level coverage: *.yourdomain.com matches a.yourdomain.com but not a.b.yourdomain.com. For that you'd need *.*.yourdomain.com — and not all providers support it.
  • Ignoring explicit records: if mail.yourdomain.com → IP1 already exists and you add * → IP2, mail will still go to IP1. That's correct behavior — just make sure it's intentional.

Browse more DNS guides in our domains category.

Key takeaways

  • A wildcard record (*) covers all first-level subdomains with a single DNS entry.
  • Use an A record for a fixed IP; use a CNAME when pointing to another hostname.
  • Explicit records always override the wildcard.
  • A wildcard DNS record does not secure HTTPS on its own — you also need a wildcard SSL certificate.
  • The web server must be configured to accept requests for any subdomain.
  • Propagation takes minutes to 48 hours; monitor with dig or online tools.

Ready to launch unlimited subdomains? The team at elenlace.com can help you configure your DNS zone and wildcard certificate from scratch.

FAQ

Does the wildcard affect the root domain (yourdomain.com)?

No. The * record only covers subdomains. The root domain and www need their own A or CNAME records.

Can I have a wildcard and specific subdomains at the same time?

Yes. Specific records take priority. For example, if you have mail.yourdomain.com → 10.0.0.1 and * → 10.0.0.2, mail still points to 10.0.0.1 and everything else goes to 10.0.0.2.

Does a wildcard work with Cloudflare?

Yes. In Cloudflare you can create an A or CNAME record with the name *. On free plans, wildcard records are DNS-only (grey cloud); the orange cloud (proxy) for wildcards requires a Pro plan or higher.

How long does it take for a wildcard record to go live?

It depends on the TTL and resolver caches. With a TTL of 300 seconds most resolvers pick it up in minutes; with a TTL of 86,400 it can take up to 24 hours.

Further reading

Other providers and guides worth comparing:

← All