Multi-tenant apps
Each customer gets customer.example.com without a DNS change per customer.
Monitor
Protect
Manage
By role
Security
Renewals
Monitoring
A wildcard DNS record has a name starting with an asterisk, such as *.example.com, and answers queries for any subdomain that has no record of its own. It matches only the missing names, never example.com itself and never a name that already exists.
| Query | Answer | Why |
|---|---|---|
| blog.example.com | 192.0.2.10 | No explicit record, so the wildcard answers |
| www.example.com | 192.0.2.20 | An explicit record exists, so the wildcard is not used |
| example.com | No answer | The wildcard does not match its own parent |
| a.b.example.com | No answer | Deeper names need *.b.example.com (or a record under b) |
| blog.example.com (type MX) | No answer | Only record types present at the wildcard are synthesized |
Rules from RFC 4592 and RFC 1034, 4.3.3. A name with other records below it can also block matching.
*.example.com. 3600 IN A 192.0.2.10
*.example.com. 3600 IN AAAA 2001:db8::10
; wildcard CNAME for a multi-tenant app
*.app.example.com. 3600 IN CNAME tenants.example-saas.net.Each customer gets customer.example.com without a DNS change per customer.
Preview environments resolve automatically; the server decides which to serve.
Every misspelled subdomain resolves, which hides mistakes and can aid phishing. Keep the server strict.
Type A, AAAA or CNAME, name *, value as for a normal record. Some panels write the name as * and some as *.example.com.
Existing www, mail and api records keep working; the wildcard fills only the gaps.
Run nslookup definitely-not-real.example.com 1.1.1.1. It should return the wildcard value.
The web server must accept unknown hostnames (a default virtual host) and TLS needs a wildcard certificate or one per name.
A name with any record of its own is not answered by the wildcard for other types if that name exists.
A wildcard A record does not create MX answers. Each type you need must be added at the wildcard.
RFC 4592 allows more than one asterisk label, such as *.*.example.com, but support differs by DNS host.
A wildcard record uses an asterisk as the leftmost label, such as *.example.com. The name server answers with its value for any query under that name that has no more specific record.
No. A wildcard never matches the name it hangs from. The root domain needs its own record, so a zone usually has both an apex A record and a wildcard.
A wildcard can carry MX, but only for names that have no records of their own, and an explicit record on a name stops the wildcard from applying there. Test with a made-up subdomain before relying on it.
No. The DNS wildcard decides which address a subdomain resolves to. A wildcard certificate decides which hostnames a TLS certificate covers. You usually need both for unlimited subdomains over HTTPS.
A wildcard only matches names below it, so *.example.com never answers for example.com itself. Add a separate record for the root domain, usually an A record, and keep the wildcard for subdomains.
Aepto monitors expiry, DNS, SSL and uptime for every domain you own and alerts you when something changes. Free for 3 domains.