{"id":4582,"date":"2024-07-13T11:38:41","date_gmt":"2024-07-13T06:08:41","guid":{"rendered":"https:\/\/www.veeble.org\/kb\/?p=4582"},"modified":"2025-04-11T12:52:21","modified_gmt":"2025-04-11T07:22:21","slug":"how-to-set-up-wildcard-domains","status":"publish","type":"post","link":"https:\/\/www.veeble.com\/kb\/how-to-set-up-wildcard-domains\/","title":{"rendered":"How To Set-Up Wildcard Domains"},"content":{"rendered":"\n<p>Setting up a wildcard domain allows you to manage multiple subdomains with a single configuration. This is particularly useful for applications that need to handle dynamic subdomain creation or manage numerous subdomains efficiently. In this guide, we will provide a detail explanation of what is wildcard domains, Advantages and how to setup wild card domains &#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a href=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/How-To-Set-Up-Wildcard-Domains.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1536\" height=\"1024\" src=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/How-To-Set-Up-Wildcard-Domains.jpg\" alt=\"How To Set-Up Wildcard Domains\" class=\"wp-image-8581\" style=\"width:772px;height:auto\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/How-To-Set-Up-Wildcard-Domains.jpg 1536w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/How-To-Set-Up-Wildcard-Domains-300x200.jpg 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/How-To-Set-Up-Wildcard-Domains-1024x683.jpg 1024w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/How-To-Set-Up-Wildcard-Domains-768x512.jpg 768w\" sizes=\"auto, (max-width: 1536px) 100vw, 1536px\" \/><\/a><\/figure>\n\n\n\t\t\t\t<div class=\"wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-6b01403f      \"\n\t\t\t\t\tdata-scroll= \"1\"\n\t\t\t\t\tdata-offset= \"30\"\n\t\t\t\t\tstyle=\"\"\n\t\t\t\t>\n\t\t\t\t<div class=\"uagb-toc__wrap\">\n\t\t\t\t\t\t<div class=\"uagb-toc__title\">\n\t\t\t\t\t\t\tTable Of Contents\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"uagb-toc__list-wrap \">\n\t\t\t\t\t\t<ol class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#what-is-wildcard-domains\" class=\"uagb-toc-link__trigger\">What is Wildcard domains?<\/a><li class=\"uagb-toc__list\"><a href=\"#advantages-of-wildcard-domains\" class=\"uagb-toc-link__trigger\">Advantages of Wildcard Domains<\/a><li class=\"uagb-toc__list\"><a href=\"#guide-to-setup-wildcard-domains\" class=\"uagb-toc-link__trigger\">Guide to Setup Wildcard Domains<\/a><ul class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#configuring-dns-settings\" class=\"uagb-toc-link__trigger\">Configuring DNS Settings<\/a><li class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#setting-up-wildcard-domains-in-cpanel\" class=\"uagb-toc-link__trigger\">Setting Up Wildcard Domains in cPanel<\/a><li class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#configuring-apache\" class=\"uagb-toc-link__trigger\">Configuring Apache<\/a><\/li><\/ul><\/li><li class=\"uagb-toc__list\"><a href=\"#verifying-the-setup\" class=\"uagb-toc-link__trigger\">Verifying the Setup<\/a><li class=\"uagb-toc__list\"><a href=\"#limitations-of-wildcard-domains\" class=\"uagb-toc-link__trigger\">Limitations of Wildcard Domains<\/a><li class=\"uagb-toc__list\"><a href=\"#conclusion\" class=\"uagb-toc-link__trigger\">Conclusion<\/a><ul class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#start-building-your-website-with-our-cpanel-hosting\" class=\"uagb-toc-link__trigger\">Start Building Your Website with Our cPanel Hosting<\/a><\/ul><\/ul><\/ol>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\n\n<h2 class=\"wp-block-heading\" id=\"what-is-wildcard-domains\">What is Wildcard domains?<\/h2>\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/07\/Rectangles-are-for-action-points.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/07\/Rectangles-are-for-action-points-1024x576.jpg\" alt=\"wildcard domains\" class=\"wp-image-4583\" style=\"width:640px;height:auto\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/Rectangles-are-for-action-points-1024x576.jpg 1024w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/Rectangles-are-for-action-points-300x169.jpg 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/Rectangles-are-for-action-points-768x432.jpg 768w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/Rectangles-are-for-action-points-1536x864.jpg 1536w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/Rectangles-are-for-action-points.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>A wildcard domain is a <a href=\"https:\/\/www.cloudflare.com\/learning\/dns\/what-is-dns\/\" target=\"_blank\" rel=\"noopener\">domain name system (DNS)<\/a> record that matches requests for <strong>non-existent subdomains<\/strong>. It is specified by using an asterisk (<code><strong>*<\/strong><\/code>) as a placeholder for any subdomain. For example, <code>*.example.com<\/code> would match any subdomain like <code><strong>blog.example.com<\/strong><\/code>, <code><strong>shop.example.com<\/strong><\/code>, or any other subdomain under <code>example.com<\/code>.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"advantages-of-wildcard-domains\">Advantages of Wildcard Domains<\/h2>\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Ease of Management<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Simplifies DNS management by reducing the need to create separate records for each subdomain.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Scalability<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Allows for the automatic handling of new subdomains without additional configuration.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Flexibility<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Ideal for applications where subdomains are created dynamically, such as multi-tenant applications.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Reduced Configuration<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Minimizes the need for manual updates and maintenance.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n<h2 class=\"wp-block-heading\" id=\"guide-to-setup-wildcard-domains\">Guide to Setup Wildcard Domains<\/h2>\n\n\n<p>A wildcard domain allows all subdomains of a domain to be directed to a single location. For example, <code>*.example.com<\/code> will include <code>blog.example.com<\/code>, <code>shop.example.com<\/code>, and any other subdomain.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"configuring-dns-settings\">Configuring DNS Settings<\/h3>\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Login to your DNS management panel<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Navigate to the DNS management section where you manage your domain records.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Create a new A Record<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Add an A record with the following details:\n<ul class=\"wp-block-list\">\n<li><strong>Host:<\/strong> <code>*<\/code><\/li>\n\n\n\n<li><strong>Points to:<\/strong> [Your Server IP Address]<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>This will route all subdomains to the specified IP address.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Adding CNAME Records<\/strong>:\n<ul class=\"wp-block-list\">\n<li>If you prefer to use CNAME records, create a CNAME record with the following details:\n<ul class=\"wp-block-list\">\n<li><strong>Host:<\/strong> <code>*<\/code><\/li>\n\n\n\n<li><strong>Points to:<\/strong> <code>example.com<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>This will alias all subdomains to the main domain.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n<h3 class=\"wp-block-heading\" id=\"setting-up-wildcard-domains-in-cpanel\">Setting Up Wildcard Domains in cPanel<\/h3>\n\n\n<p>1.<strong>Login to cPanel<\/strong>:<br>-&gt;Use your credentials to access your <a href=\"https:\/\/www.veeble.org\/in\/cpanel-hosting\/\" target=\"_blank\" rel=\"noopener\">cPanel <\/a>account.<\/p>\n\n\n\n<p><strong>2. Navigate to the Domains Section:<br><\/strong>       -&gt;Click on <strong>Subdomains<\/strong>\/<strong>Domains<\/strong>.<\/p>\n\n\n\n<p><strong>3. Add a Wildcard Subdomain:<\/strong><\/p>\n\n\n\n<p>-&gt; In the Subdomain field, enter <code><strong>*<\/strong><\/code>.<br>-&gt; Select the domain you want to add the wildcard for:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-13-113226.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"529\" src=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-13-113226.png\" alt=\"wildcard domain creation in cpanel\" class=\"wp-image-4588\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-13-113226.png 969w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-13-113226-300x164.png 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-13-113226-768x419.png 768w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/><\/a><\/figure>\n\n\n\n<p>The Document Root will automatically populate. You can change it if needed, but typically, it&#8217;s set to <code>\/public_html<\/code>.<\/p>\n\n\n\n<p><strong>4. Click Submit.<\/strong><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"configuring-apache\">Configuring Apache <\/h3>\n\n\n<p>If you are using an Apache server, you need to enable wildcard subdomains in your virtual host configuration.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Open your Apache configuration file<\/strong> (usually located in <code>\/etc\/httpd\/conf\/httpd.conf<\/code> or <code>\/etc\/apache2\/sites-available\/000-default.conf<\/code>).<\/li>\n\n\n\n<li><strong>Add the following configuration<\/strong>:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;VirtualHost *:80&gt;\n    ServerAlias *.example.com\n    DocumentRoot \/var\/www\/html\n&lt;\/VirtualHost&gt;<\/code><\/pre>\n\n\n\n<p>3. <strong>Restart Apache<\/strong>:<\/p>\n\n\n\n<p>Run the below command .<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>systemctl restart apache2<\/code>         or \n<span style=\"background-color: initial;color: var(--ast-global-color-3)\">systemctl restart httpd<\/span><\/code><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id=\"verifying-the-setup\">Verifying the Setup<\/h2>\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Test your Wildcard Subdomain<\/strong>\n<ul class=\"wp-block-list\">\n<li>Open a web browser and navigate to any subdomain, such as <code>test.example.com<\/code>.<\/li>\n\n\n\n<li>It should direct you to the main domain\u2019s document root or the specified folder.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Troubleshooting<\/strong>\n<ul class=\"wp-block-list\">\n<li>If it doesn&#8217;t work, check your DNS propagation. It can take up to 24-48 hours for DNS changes to propagate fully.<\/li>\n\n\n\n<li>Ensure your server and DNS configurations are correct.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n<h2 class=\"wp-block-heading\" id=\"limitations-of-wildcard-domains\">Limitations of Wildcard Domains<\/h2>\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Wildcard Certificates<\/strong>:\n<ul class=\"wp-block-list\">\n<li>SSL\/TLS certificates need to be wildcard certificates to cover all subdomains, which might be more expensive.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Subdomain Control<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Limited control over individual subdomains as they all point to the same location.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>DNS Propagation<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Changes can take up to 24-48 hours to propagate, affecting new subdomains immediately.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n<p>Setting up wildcard domains can simplify the management of multiple subdomains and improve your website&#8217;s scalability. Follow these steps carefully to configure wildcard domains for your website. If you encounter any issues, consult your hosting provider for support.<\/p>\n\n\n\n<div style=\"height:35px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-uagb-call-to-action uagb-block-18cf4e77 wp-block-button\"><div class=\"uagb-cta__wrap\"><h3 class=\"uagb-cta__title\">Start Building Your Website with Our cPanel Hosting<\/h3><p class=\"uagb-cta__desc\">Veeble&#8217;s cPanel hosting is the perfect choice for businesses and individuals who want to create a professional website.<\/p><\/div><div class=\"uagb-cta__buttons\"><a href=\"https:\/\/www.veeble.com\/in\/cpanel-hosting\/\" class=\"uagb-cta__button-link-wrapper wp-block-button__link\" target=\"_blank\" rel=\"noopener noreferrer\">Get Started Today!<svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\"><path d=\"M504.3 273.6l-112.1 104c-6.992 6.484-17.18 8.218-25.94 4.406c-8.758-3.812-14.42-12.45-14.42-21.1L351.9 288H32C14.33 288 .0002 273.7 .0002 255.1S14.33 224 32 224h319.9l0-72c0-9.547 5.66-18.19 14.42-22c8.754-3.809 18.95-2.075 25.94 4.41l112.1 104C514.6 247.9 514.6 264.1 504.3 273.6z\"><\/path><\/svg><\/a><\/div><\/div>\n\n\n\n<div style=\"height:35px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Related Searches&nbsp;<\/strong>:-<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-veeble-hosting wp-block-embed-veeble-hosting\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/www.veeble.org\/kb\/cpanel-dns-configuration-using-nameservers\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-veeble-hosting wp-block-embed-veeble-hosting\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/www.veeble.org\/kb\/proxy-subdomains\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Setting up a wildcard domain allows you to manage multiple subdomains with a single configuration. This is particularly useful for applications that need to [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":8581,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[22],"tags":[],"class_list":["post-4582","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-domain"],"uagb_featured_image_src":{"full":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/How-To-Set-Up-Wildcard-Domains.jpg",1536,1024,false],"thumbnail":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/How-To-Set-Up-Wildcard-Domains-150x150.jpg",150,150,true],"medium":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/How-To-Set-Up-Wildcard-Domains-300x200.jpg",300,200,true],"medium_large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/How-To-Set-Up-Wildcard-Domains-768x512.jpg",768,512,true],"large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/How-To-Set-Up-Wildcard-Domains-1024x683.jpg",1024,683,true],"1536x1536":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/How-To-Set-Up-Wildcard-Domains.jpg",1536,1024,false],"2048x2048":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/07\/How-To-Set-Up-Wildcard-Domains.jpg",1536,1024,false]},"uagb_author_info":{"display_name":"Nayana Nair","author_link":"https:\/\/www.veeble.com\/kb\/author\/nayana\/"},"uagb_comment_info":0,"uagb_excerpt":"Setting up a wildcard domain allows you to manage multiple subdomains with a single configuration. This is particularly useful for applications that need to [&hellip;]","_links":{"self":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/4582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/comments?post=4582"}],"version-history":[{"count":8,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/4582\/revisions"}],"predecessor-version":[{"id":8582,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/4582\/revisions\/8582"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media\/8581"}],"wp:attachment":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media?parent=4582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/categories?post=4582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/tags?post=4582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}