A wildcard record (*.example.com) answers for every hostname that has no explicit record of its own, and on today’s Cloudflare it can be proxied on every plan — Free included — since wildcard proxying stopped being Enterprise-only in 2022. The real limits are elsewhere: a wildcard never covers the apex, an explicit record at a name switches the wildcard off for that name entirely, and the Universal SSL certificate only covers one label deep, so a.b.example.com resolves through the wildcard but fails TLS until you add Advanced Certificate Manager or restructure.
What’s happening
Wildcard matching follows DNS rules, not glob rules. *.example.com synthesizes an answer for any queried name under the zone that does not exist — but “exist” means any record type. If shop.example.com has only a TXT record, an A query for shop returns an empty answer, not the wildcard’s IP, because the name exists and therefore blocks synthesis. Conversely, a name with no records at all matches even several labels deep: x.y.example.com gets the wildcard answer as long as nothing exists at y.example.com in between. Neither behaviour is Cloudflare-specific; both surprise people weekly.
Proxy status adds the Cloudflare layer. A proxied wildcard means every matched hostname resolves to Cloudflare anycast IPs and rides through the edge to your origin: WAF, caching, and origin-IP privacy for names you never explicitly created. That is available on Free, Pro, and Business alike. What does not stretch with the wildcard is TLS. The Universal certificate covers example.com plus *.example.com — one level. A wildcard-matched name two labels deep terminates TLS at the edge with a certificate that does not include it, and browsers refuse. Coverage for deeper names requires the Advanced Certificate Manager add-on (purchasable on any plan) or a redesign to single-level names. The certificate rules live in Cloudflare’s SSL docs; the record behaviour in the DNS docs.
One structural exception: zones on a partial (CNAME) setup — a Business-plan option where your existing DNS host stays authoritative — cannot proxy wildcards; full-setup zones, which is what Free and Pro always are, can.
What to check first
- Whether the zone already has a wildcard, and for which types — A, AAAA, and CNAME wildcards behave independently.
- Which explicit records exist under the zone, since each one carves a hole in the wildcard’s coverage.
- Whether any hostname you rely on sits more than one label deep.
- The wildcard’s proxy status, and whether your origin has a catch-all vhost ready to receive arbitrary Host headers.
- Whether the apex has its own record — the wildcard will never answer for
example.comitself.
How to verify
# A name with no explicit record should get the wildcard answer
dig +short A random-test-1234.example.com @1.1.1.1
# A name that exists with another type blocks the wildcard for A queries
dig A shop.example.com @1.1.1.1 | grep -E "status|ANSWER"
# Multi-level names match too, if nothing exists in between
dig +short A x.y.example.com @1.1.1.1
# Proxied wildcard returns Cloudflare ranges; DNS-only returns your origin
dig +short A anything.example.com @1.1.1.1
# TLS depth check: one level works, two levels fails on Universal SSL
curl -sv https://one-level.example.com/ -o /dev/null 2>&1 | grep -E "subject|HTTP"
curl -sv https://two.levels.example.com/ -o /dev/null 2>&1 | grep -iE "subject|error|HTTP"
If the random single-level name returns edge IPs and serves your site, the proxied wildcard is doing its job. If the two-level curl fails the handshake while DNS resolves fine, you have hit the certificate boundary, not a DNS problem.
The fix
- Create the wildcard deliberately. In DNS → Records, add
*as the name with the target of your catch-all origin. Decide proxy status on purpose: orange for “every subdomain is my web app” (multi-tenant SaaS, per-customer subdomains), grey when arbitrary names must reach the origin IP directly. - Pin the important names explicitly. Anything with its own lifecycle —
mail,api,staging— deserves its own record even if the wildcard would cover it. Explicit records survive wildcard edits and make the zone legible. The type-by-type conventions are in the Cloudflare DNS record cookbook. - Give the apex its own record.
*.example.comdoes not matchexample.com. An apex A/AAAA (or flattened CNAME) is always required separately. - Solve TLS depth before it solves itself in production. For hostnames deeper than one label behind the proxy: add Advanced Certificate Manager and issue a certificate covering
*.b.example.com, or flatten the naming scheme to one level. Do not leave it to “we’ll see” — the failure mode is a full-screen browser warning on a customer-facing name. - Prepare the origin for the traffic. A proxied wildcard forwards any Host header a visitor invents. Your web server’s default vhost should return something intentional (a 404 or a redirect), not the first configured site on the IP.
When this fix is wrong
If you want a wildcard mainly so that unknown names stop erroring, ask why unknown names get traffic at all — a wildcard that papers over typo’d links and stale DNS from third parties also hides real inventory problems, and it makes subdomain-takeover style audits harder because everything “resolves”. If only two or three subdomains matter, explicit records are simpler, cheaper to reason about, and safer than a catch-all. And if the requirement is a wildcard certificate rather than wildcard DNS, those are different purchases — the proxied edge cert already covers one level regardless of how many explicit records you have.
Common mistakes
- Expecting the wildcard to cover the apex, then debugging why
example.comis dead while every subdomain works. - Forgetting that a lone TXT record at a name blocks A-record synthesis for that name.
- Proxying a wildcard on a two-level naming scheme and shipping TLS errors to production.
- Leaving the origin’s default vhost serving an internal site to every random Host header the wildcard lets through.
Prevention
- Audit the zone quarterly: list explicit records, confirm each hole punched in the wildcard is intentional.
- Keep a staging copy of the naming scheme and test a fresh random hostname (DNS + TLS) after every wildcard change.
- Document that the wildcard exists and what it points at — it is invisible in most inventories precisely because nothing references it.
- Alert on certificate errors at the edge, not just origin health, so depth problems surface before customers do.
Wildcards are a commitment: every name you have not thought of now resolves, in public, to something you run. Moving a production zone onto Cloudflare without dropping mail or exposing the origin is exactly the kind of work Stack Harbor handles under Managed Cloud Ops — book an infrastructure review if you want it done with a rollback plan.