How to set up a wildcard DNS record
One record that answers for every undefined subdomain of a domain at once, along with the SSL and security trade-offs that come with it.
A wildcard DNS record answers for any subdomain that does not already have a more specific record of its own, using an asterisk as the name instead of a specific word. One record covers anything.yourdomain.com, without needing a separate entry for every possible subdomain someone might type.
What the record looks like
*.yourdomain.com. A 203.0.113.10
The asterisk stands in for any single label at that position. This record answers for shop.yourdomain.com, test.yourdomain.com, and any other undefined subdomain — but it does not match a subdomain that already has its own specific record, since a specific match always takes priority over a wildcard.
A record for *.yourdomain.com matches anything.yourdomain.com, but it does not match anything.subdomain.yourdomain.com — a wildcard covers exactly one label at the position of the asterisk, not everything beneath it at any depth.
What it is actually useful for
- Multi-tenant platforms. A service that gives each customer their own subdomain —
customer1.yourplatform.com,customer2.yourplatform.com— can use one wildcard record rather than adding a new DNS entry every time a customer signs up. - Catching every possible typo or variant. Some sites use a wildcard to make sure nothing under the domain ever returns a plain DNS error, routing anything unrecognised to a single application that decides what to do with it.
- Staging and preview environments. Development setups that spin up a new subdomain per branch or feature can rely on a wildcard so DNS never needs manual updating as new ones appear and disappear.
Setting one up
In the DNS section of your control panel, add a new record and enter * as the name. Depending on what the wildcard should point to, choose:
- An A record, if every matching subdomain should resolve to the same IP address.
- A CNAME record, if every matching subdomain should follow another name instead.
Save it, and — after normal DNS spreading time — any subdomain not already defined elsewhere will start resolving through this record.
The SSL problem a wildcard record creates
A wildcard DNS record makes any subdomain resolve, but resolving is not the same as being secured. If you want HTTPS to work correctly on subdomains covered only by the wildcard record, you need a wildcard SSL certificate covering *.yourdomain.com specifically — an ordinary certificate for the bare domain, or for one specific subdomain, does not automatically extend to cover every name a wildcard DNS record answers for. See what a wildcard SSL certificate is for that side of the setup.
A wildcard record means literally any subdomain someone guesses will resolve to something, which is not always what you want. If an application behind the wildcard is not built to handle arbitrary, unexpected subdomain names gracefully, this can expose more of it than intended, or make it easier for someone probing your domain to find an unfinished or forgotten area of a site. Only use a wildcard where the application behind it is genuinely designed to accept any subdomain.
Wildcards and TTL
A wildcard record carries a TTL exactly like any other record, and it is worth setting deliberately rather than leaving at whatever your control panel defaults to. Because a wildcard often sits behind infrastructure that changes more often than a typical static site — new customer subdomains appearing, application servers being replaced — a shorter TTL can be the more sensible default here than it would be for an ordinary A record you rarely touch. See what a DNS TTL is for the trade-offs involved in choosing one.
Checking it is working
dig +short somethingrandom.yourdomain.com
Pick a subdomain you are confident has never been used before. If the wildcard is correctly configured and has spread, this should return the same answer as the wildcard record, even though that exact name has never been individually created.
Removing or narrowing a wildcard later
If a wildcard turns out to be too broad, delete the record and add specific ones only for the subdomains you actually need — there is no partial or scoped wildcard option beyond what has already been covered here. Since a specific record always takes priority over a wildcard while both exist, you can also add exceptions gradually: create a specific record for any subdomain you want to behave differently, and leave the wildcard in place for everything else.
Wildcard records are a narrower tool than most of the DNS setups covered in every DNS record type explained — most sites never need one, and adding it only when a genuine use case exists avoids taking on complexity and exposure with nothing to show for it.
Related reading
What each DNS record type actually does, in plain terms, and the handful you will realistically ever need to touch.
How to add or edit an A recordWhere to find the A record setting in your DNS zone, what each field means, and how to confirm the change actually took.
What is a wildcard SSL certificate?One certificate that covers a domain and every first-level subdomain under it, instead of issuing and managing one for each.
Can I use a domain I bought somewhere else?Yes — a domain registered anywhere can be hosted with us without ever moving its actual registration.