Wildcard DNS records: when to use one, when not to
21 October 2026 · Jimmy
A wildcard record answers for names you never created:
*.example.com. IN A 203.0.113.10
Ask for anything.example.com and you get that address. Ask for whatever-you-like.example.com and you get it too.
That is useful in a few real situations and a quiet liability in several others. The difference is worth knowing before you add one.
What it actually matches
The rules are narrower than most people assume, and each surprise below is a rule in RFC 4592 rather than an implementation quirk.
It matches one label, not many. *.example.com answers for foo.example.com. Whether it answers for foo.bar.example.com depends on there being no closer match — and in practice, relying on it for deeper names is how people get confused. If you need those, add *.bar.example.com as well.
It does not match the apex. *.example.com says nothing about example.com itself. The bare domain needs its own record.
An existing name beats the wildcard, entirely. This is the one that causes real incidents. If www.example.com has any record — even of a completely different type — the wildcard stops applying to www for every type.
So with:
*.example.com. IN A 203.0.113.10
www.example.com. IN TXT "some verification string"
…www.example.com has no address at all. The TXT record made www an existing name, and existing names do not fall through to the wildcard. The site breaks, and the change that broke it was adding an unrelated verification record.
It is per-type in what it answers, but not in what blocks it. A wildcard A record answers A queries. A query for MX at a name covered by the wildcard gets "no such record" — not a referral to the wildcard. But as above, any record at a name removes that name from the wildcard's reach for everything.
Where a wildcard earns its place
- Multi-tenant applications, where every customer gets
customer.app.example.comand creating records per signup is unnecessary work. - Development and preview environments —
branch-name.dev.example.compointing at one machine that routes byHostheader. - Catching typos deliberately, where a wildcard sends every mistyped subdomain to a page that explains rather than a browser error.
The common thread: the routing decision genuinely happens above DNS, in something reading the hostname. DNS is just getting the traffic to the right box.
Where it causes trouble
Mail. A wildcard A record means every name resolves, so the implicit-MX fallback means every subdomain appears to accept mail. Spammers enumerate this. A wildcard plus no explicit MX policy is an invitation.
If you use a wildcard, publish a null MX on the wildcard too:
*.example.com. IN MX 0 .
Certificates. A wildcard DNS record does not give you a wildcard certificate, and the two are unrelated. Every name answering does not mean every name has a valid certificate — visitors to unconfigured names will meet certificate errors rather than a clean failure.
Debugging. Nothing ever returns NXDOMAIN, so a typo resolves happily and fails one layer further on, with a much less obvious message. "Does this name exist?" stops being a question DNS can answer.
Security scanning. Subdomain enumeration against a wildcard returns everything, which makes it hard for you to audit what you actually publish — and hides a genuine stray record among infinite fictional ones.
A safer default
For most domains, name the subdomains you use. It is a few more records, and in exchange a typo fails immediately, mail cannot be sent to imaginary hosts, and your zone is a description of reality.
Reach for a wildcard when the set of names is genuinely open-ended and generated by something other than a person. When you do:
- Add a null MX on the wildcard.
- Add explicit records for names that matter, remembering that doing so removes them from the wildcard entirely.
- Write down that the wildcard exists. The next person to debug a resolving-but-broken subdomain will spend an hour on it otherwise.
Checking what you have
dig +short does-not-exist-12345.example.com
An answer to a name you never created means a wildcard is in play. That is a useful thing to run against your own domains occasionally — wildcards are frequently older than the people maintaining the zone.
Wildcards are supported on every KumoDNS plan; the record name is simply *.
Need somewhere to put these records?
KumoDNS hosts one zone free — no card, no time limit.