What a wildcard record actually does

A wildcard DNS record provides an answer for names that do not otherwise have a matching entry in a zone. For example, an A record at *.example.com might direct an undefined name such as preview.example.com to the same IP address as other undefined names. This can be useful when an application creates subdomains dynamically. It does not, however, create a separate website or application configuration for each name. The destination server still needs to recognize the requested hostname and handle it appropriately.

A wildcard is not a simple replacement for every record below a domain. DNS matching depends on which names already exist in the zone and what a resolver asks for. An explicitly configured name generally takes precedence over a wildcard at the relevant level, while an existing name without the requested record type may behave differently from a name that does not exist at all. Rather than assume a wildcard covers a particular hostname, test that hostname and record type directly.

Where catch-all answers become a security concern

The main risk is not that wildcard DNS is inherently unsafe. It is that a broad catch-all can make unintended hostnames resolve to a live service. A typo, an old hostname in a document, or a name invented by an outsider may all reach the same destination. If that service serves a default page, accepts requests for arbitrary hostnames, or uses hostname-based routing, its behavior matters more than the DNS answer alone. A wildcard may also make it harder to notice that a specific record was deleted: the name can continue resolving, but to the wrong place.

The consequences depend on what the destination does. A well-configured application may reject unrecognized hostnames. A less restrictive one might display the wrong site, expose a generic administration page, or confuse a user who expected a particular service. DNS resolution also does not guarantee that HTTPS will work: the server needs a certificate valid for the requested hostname. A wildcard DNS record and a wildcard TLS certificate are separate things, and neither automatically secures the other.

Catch-all records can complicate email expectations as well. A wildcard MX record, for example, may cause mail addressed to otherwise undefined subdomains to be directed somewhere instead of failing at the DNS lookup stage. That is a different choice from using a wildcard A record for web traffic. Before adding any wildcard, identify which record type the application needs and avoid copying a web-oriented pattern into mail settings without a clear reason.

How to review an existing wildcard

Start by recording the wildcard’s name, record type, destination, and intended purpose. Then list the services that are supposed to use it. If the purpose is dynamic web hosting, check how the destination handles an expected hostname, a misspelled hostname, and an arbitrary hostname you control for testing. Look at both the DNS response and the resulting web response. A successful DNS lookup alone tells you little about whether the application routes the request safely.

Check a few explicitly configured names too. Their answers should still lead to the intended services. If you find an unexpected answer, investigate the zone layout and the exact record type queried before changing anything. For web services, confirm that unrecognized hostnames do not expose content intended for another tenant or application. For HTTPS, check that expected names have appropriate certificate coverage and that an invalid certificate is not being treated as a normal user experience.

Use harmless test names and avoid entering credentials or sensitive information while checking an unfamiliar destination. Keep notes on what the wildcard is meant to support; otherwise, a future maintainer may remove it because it appears unused or retain it long after the application that needed it has gone.

Choosing a narrower alternative

If only a small, known set of subdomains needs to resolve, explicit records are usually easier to review. They make it clearer which names are intentional and reduce the chance that a typo silently reaches a live service. Where dynamic names are essential, consider limiting the wildcard to a dedicated branch, such as *.preview.example.com, rather than placing it across a broader area of the domain. That gives the application room to create names while keeping unrelated services separate.

Before narrowing or removing a wildcard, check whether existing applications depend on names that are not listed individually. Plan the change with the people who manage those applications, add explicit records where needed, and test expected names after the update. The goal is not to avoid wildcards at all costs. It is to make the DNS answer, the server’s hostname handling, and the intended scope agree.

Back to category ↗