Skip to main content
短.be

Wildcard DNS

A DNS configuration that uses an asterisk (*) to point all subdomains to a single IP address with one record, enabling efficient management of large numbers of subdomains.

Aug 24, 2026 · About 1 min read

Redirect

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.

Share on XHatena

Was this article helpful?

Related Terms

Related Articles

FAQ

When is wildcard DNS used?
It is common in SaaS platforms that assign subdomains per customer, multi-tenant applications, and URL shortening services with custom domain features. It eliminates the need to create individual DNS records for each subdomain.
What are the security risks of wildcard DNS?
Because any subdomain resolves to your server, requests for non-existent subdomains also arrive. The server must validate hostnames and return a 404 for unrecognized subdomains.
Do I need a wildcard SSL certificate?
A single wildcard certificate (*.example.com) is the simplest way to serve HTTPS on every subdomain. Issuing a separate certificate per subdomain also works, but issuance and renewal get harder to manage as the count grows. Let's Encrypt issues wildcard certificates for free, yet only through the DNS-01 challenge, which proves ownership with a DNS TXT record; HTTP-01 cannot issue them. That assumes DNS records can be updated automatically.

Put the terms to work

Shorten a URL for Free