Wildcard DNS is a DNS record configuration that uses an asterisk (*) in the hostname field to direct any subdomain to the same IP address or domain with a single record. Setting "*.example.com" routes abc.example.com, xyz.example.com, and anything.example.com to the same server.
The configuration is as simple as "*.example.com A 192.0.2.1." If an explicit record exists for a specific subdomain, it takes precedence; the wildcard acts as a fallback. The matching rules have subtleties: a wildcard matches even when several labels remain, but it is not used when another name exists between the queried name and the wildcard's parent. foo.bar.example.com matches *.example.com, yet once bar.example.com holds any record the match stops working and a separate *.bar.example.com is needed.
In URL shortening services, wildcard DNS enables per-user custom subdomains. Assigning "user1.short.example.com" and "user2.short.example.com" to individual users requires no per-subdomain DNS records when a wildcard is in place. The server inspects the Host header to identify the user.
SaaS platforms use wildcard DNS widely as well. When every customer receives a subdomain, a wildcard means no DNS record has to be added as tenants arrive, which makes it the default choice for products of that shape. Once subdomains reach the thousands, issuing and retiring individual records stops being practical to operate.
A key caveat is that wildcard DNS accepts requests for any subdomain, including non-existent ones. The server must validate the requested hostname and return an appropriate error page for unknown subdomains. Combining wildcard DNS with a wildcard SSL certificate (*.example.com) enables HTTPS across all subdomains.