Skip to content
inetGeek

Wildcard DNS records

A wildcard record answers for any subdomain you have not defined explicitly. It is useful and it is a common way to create surprises.

01.

What a wildcard matches

A record whose name begins with an asterisk label — *.example.com — answers queries for any name at that level which has no record of its own.

Wildcards are the usual way to serve a subdomain per customer without adding a record for each one.

02.

What a wildcard record looks like

A wildcard is an ordinary record whose name begins with an asterisk label: *.example.com. 3600 IN A 192.0.2.1. Nothing else about it is special, and any record type can be published this way.

The asterisk must be the whole leftmost label. A name like www*.example.com is not a wildcard, it is a literal name containing an asterisk, and it matches only itself.

03.

Any explicit record wins

A wildcard only applies where nothing else exists. If app.example.com has any record of its own, the wildcard never applies to it — and that is true per name, not per record type.

This surprises people: adding a TXT record to app.example.com for a verification check stops the wildcard A record from answering for app.example.com too, and the subdomain goes dark.

Does the wildcard answer?zone: example.com

Zone

Zone file

Answer

Illustrative zone. A wildcard answers only for names that have no records of their own — any record, of any type, at that exact name switches it off.
04.

Deeper names are a special case

Wildcard matching is defined in RFC 4592. *.example.com does match a.b.example.com, but only while no name exists between them: the moment b.example.com gets a record of its own, everything beneath it stops matching the wildcard.

A wildcard also cannot solve certificates: a wildcard TLS certificate for *.example.com covers one label, for the same reason.

Related records

When these numbers change, hear about it. Sources are re-checked monthly; a repricing goes out as a short note.

Confirm by email; unsubscribe from any issue. Your address goes to Kit and nowhere else — what we do with it.

Every page here is sourced and dated.