Wildcard Subdomains: What They Are & How To Set Them Up

A wildcard subdomain is a DNS (Domain Name System) configuration that directs all unspecified subdomains of a website to the same IP address without having to configure each one individually.

It’s represented by an asterisk (*) in DNS records.

For example, a wildcard subdomain for *.example.com will direct traffic from any subdomain that isn’t explicitly defined (like blog.example.com, shop.example.com, etc.) to the specified IP address.

In this article, we’ll look at what a wildcard subdomain is and give examples of how you can set it up through different hosting providers and DNS services.

Takeaways
  • A wildcard subdomain is an example of a subdomain that can be used to match any request for an undefined domain
  • A wildcard DNS record, or wildcard record, is a type of Domain Name System (DNS) record that will point all existing and non-existing subdomains to a specific area
  • Wildcard subdomains help people reach your website without knowing the exact name, among other helpful uses
  • Adding a wildcard subdomain to any hosting service takes just about three or four easy steps

What Is a Wildcard Subdomain?

A wildcard subdomain is a catch-all route in DNS configurations that directs any unspecified subdomain of a website to a specific directory on the server.

Essentially, when you use the asterisk (*) character instead of a specific subdomain entry in your DNS settings, the DNS server will capture requests to any unspecified subdomain and handle them according to its settings.

This is particularly useful for SaaS (Software as a Service) platforms where users might have personalized subdomains (like user1.example.com, user2.example.com) but managing each as a separate subdomain would be impractical.

Developers often use wildcard subdomains for local testing environments or to allow for dynamic subdomain creation in applications.

Wildcard Subdomains Uses

Wildcard subdomains are versatile and you can find uses in various aspects of web management and online services.

Here are some common uses:

  • Multi-tenant Applications—In applications serving multiple tenants, such as in content management systems or e-commerce platforms, wildcard subdomains allow each tenant to have their dedicated subdomain.
  • Testing and Development Environments—Developers use wildcard subdomains to easily generate new environments for testing or staging without having to configure new DNS records each time.
  • Redirection and Default Handling—They are used to redirect traffic from non-existent subdomains to a main domain or a specific page, which can improve user experience and prevent lost traffic.
  • Content Localization—For websites with a global audience, wildcard subdomains can route users to locale-specific versions of the site based on their geographic location.
  • Load Balancing and Scaling—In load balancing, wildcard subdomains can distribute the load across different servers or clusters, enhancing website performance and reliability.
  • SEO Experiments—Some SEO strategies involve using wildcard subdomains to test various content layouts or marketing approaches without affecting the main website.
  • Domain Masking—They can be used to mask affiliate links or other external links, making them appear as part of the main domain.
  • Hosting multiple websites on the same server—Useful when you need to dynamically generate websites or web pages that have their own unique subdomain, but are hosted on the same server infrastructure.

DNS Wildcard Subdomain Example

An example of a wildcard subdomain in action can be seen in a SaaS application like a project management tool.

Suppose the tool is hosted on the domain projectapp.com. The service offers each user their own subdomain for a personalized dashboard.

The SaaS provider needs to set up a wildcard subdomain, such as *.projectapp.com.

This entry means any subdomain of projectapp.com not already explicitly defined will be directed to a default location, typically the application’s main server.

When a new user signs up and chooses a unique username, say ‘johndoe’, they automatically get a personalized subdomain, like johndoe.projectapp.com. This subdomain directly leads to John’s personal dashboard. The beauty of this is that there’s no need for manual DNS configuration for each new user.

If someone types a non-existent subdomain, like random.projectapp.com, the wildcard subdomain setup ensures this request doesn’t lead to an error page but is instead handled appropriately, often redirecting to the main application or a default page.

Note

This setup simplifies domain management, enhances user experience by providing personalized URLs, and streamlines the process of onboarding new users to the SaaS platform.

How to Add a Wildcard DNS to a Subdomain

Now that you know why wildcards work well for so many website owners, try them out for yourself using these step-by-step instructions for how wildcards work with some of the top hosting providers:

IONOS Wildcard Subdomain

IONOS is a popular hosting provider known for its support staff that allows you to create and manage multiple websites from one platform.

  1. Log in to the Control Panel
  2. Select ‘Domains’ and then click on your desired domain name
  3. Select ‘Advanced DNS Settings’ and click ‘Add Record’
  4. Set the record type as ‘CNAME Wildcard’ to make a wildcard DNS record and enter the destination URL for your site in the value field before saving changes
IONOS
£0.79 /mo
Starting price
Visit IONOS
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.3

Hostinger Wildcard Subdomain

Hostinger is a great host of choice for those looking to host multiple websites from the same hostname and account.

  1. Log in to your Hostinger Account and select the Domains section from the menu bar
  2. Select ‘DNS Settings’ for your desired domain name, then click on the ‘+ Add Record’ button
  3. Set the record type as ‘CNAME Wildcard’ and enter the destination URL for your site in the value field before saving changes
Hostinger
£1.57 /mo
Starting price
Visit Hostinger
Rating based on expert review
  • User Friendly
    4.7
  • Support
    4.7
  • Features
    4.8
  • Reliability
    4.8
  • Pricing
    4.7

Let’s Encrypt Wildcard Subdomain

Let’s Encrypt is a free, automated, and open certificate authority (CA) that provides digital certificates to enable HTTPS encryption for websites.

  1. Log in to your account on their website
  2. Select ‘Certificates’ and then click on the domain name you want to use
  3. Click the ‘Add Wildcard Subdomain’ command and enter the destination URL for your site before saving changes

NGINX Wildcard Subdomain

NGINX is a powerful web server used for hosting websites and servers.

  1. Log in to your NGINX configuration file
  2. Locate the ‘server’ directive and then add a new ‘location’ block below it
  3. Set the ‘location’ as `*.your-domain-name` in the host field and define the root path of the site or page you want to direct visitors to
  4. Save changes before restarting Nginx for your changes to take effect

Cloudflare Wildcard Subdomain

Cloudflare is a DNS service provider that offers users the ability to manage their domain’s DNS settings with ease.

  1. Log in to your Cloudflare account and select ‘DNS’ from the menu on the left-hand side
  2. Click ‘Add Record’ and set the record type as ‘CNAME Wildcard’
  3. Enter your desired destination URL for the site in the value field before saving changes

Route53 Wildcard Subdomain

Route53 is a popular DNS service offered by Amazon Web Services (AWS).

  1. Log in to your AWS Console and select ‘Services’ from the top menu
  2. Choose ‘Route53’ and open up the desired hosted zone for your domain name
  3. Click on ‘Create Record Set’, set the record type as ‘CNAME Wildcard’, and enter the destination URL before saving changes

GoDaddy Wildcard Subdomain

GoDaddy is a popular domain registrar and hosting provider.

  1. Log in to the Domain Manager
  2. Select your desired domain name
  3. Click ‘Add DNS Record’ under the ‘DNS Zone File’ tab
  4. Set the record type as ‘CNAME Wildcard’ and enter your destination URL in the value field before saving changes
GoDaddy
£5.51 /mo
Starting price
Visit GoDaddy
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.6
  • Pricing
    4.0

cPanel Wildcard Subdomain

cPanel is a web hosting platform that allows you to host and manage multiple websites from the same dashboard, and how to create a subdomain in cPanel is easy.

  1. Log in to your cPanel account and select ‘Subdomains’
  2. Make a new subdomain and enter an asterisk (*) in the host field before saving changes
  3. Select ‘DNS Zone Editor’ and click ‘Add Record’
  4. Set the record type as ‘CNAME’ and enter the destination URL for your site in the value field before clicking Save changes

Final Word

Wildcard domains and subdomains can be a great way to simplify the process of hosting multiple websites on the same server.

It’s important to note that they’re also helpful for directing traffic to a single source, as they will always direct users to your specified website address.

If your website needs more help beyond setting up wildcard domains and subdomains, check out our reviews of the Best Website Builders and Best Web Hosting services.

Next Steps: What Now?

  • Get your website ready for new traffic with the Best Website Builders and Best Web Hosting
  • Learn more about subdomains and wildcards through articles like this one
  • Follow the steps above to add a subdomain to your hosting provider/DNS records service of choice

Learn More About Subdomains

Frequently Asked Questions

Can you wildcard a subdomain?

The answer is yes, you can set up a wildcard subdomain by creating a DNS record that uses the ‘*’ character to match any request for an undefined root domain.

Does a wildcard SSL cover all subdomains?

Yes, a wildcard SSL certificate will cover all subdomains that are associated with the wildcard records of the main domain it is registered to. However, this does not include wildcard records of any additional domains or top-level domains.

What is the difference between a wildcard domain and a subdomain?

A wildcard domain is a type of domain that will match any request for an undefined subdomain, while a subdomain is part of the main domain name. For example, ‘www’ would be a subdomain of ‘example.com’.

Email Marketing vs. Social Media: Which is More Effective?

What is Email Marketing? Email marketing is a  that involves companies reaching out to potential and existing customers via email ...
10 min read
Ela Gal-Kfir
Ela Gal-Kfir
Digital Marketing Specialist

Email Engagement Metrics, Calculation & Best Practices

Email engagement tells us how interested recipients are in the content of emails they receive. It provides insights into what types of em...
12 min read
Ela Gal-Kfir
Ela Gal-Kfir
Digital Marketing Specialist

Email Cadence: What Is It & How To Optimize It Right

Email cadence guides you when and how often you should reach out to your customers. Think of it as your personal plan that helps you decide wh...
15 min read
Ela Gal-Kfir
Ela Gal-Kfir
Digital Marketing Specialist

Co-Marketing: What It Is, How to Start & Benefits for Your Business

When it comes to modern business strategies, co-marketing is a smart move for businesses. It means two or more companies work together, sharin...
10 min read
Kaitlin Culmo
Kaitlin Culmo
Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top