Wildcard Subdomains: What It Is & How to Set It Up

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

Wildcard Subdomains & How to Set Them Up - blog image

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.

Top Domain Hosting Providers
User Rating
4.9
5.0
4.6
Money-Back Guarantee
30 Days
45 Days
30 Days

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
$1.00 /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
$2.99 /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.99 /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’.

HostAdvice Speaks to ScalaHosting: An Interview with Chris Rusev

HostAdvice had the opportunity to speak with Chris Rusev, the CEO and co-founder of , a web hosting company that offers shared, cloud VPS, and…
8 min read
Eddie Segal
Eddie Segal
Digital Marketing Specialist

Email Deliverability: What Is It, Key Factors & Best Practices

What is Email Deliverability? Think of it like mailing a letter and making sure it lands right in the recipient’s hands, not lost or thrown…
17 min read
Ela Gal-Kfir
Ela Gal-Kfir
Digital Marketing Specialist

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&nbsp…;
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
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