{"id":2321,"date":"2015-12-07T03:41:51","date_gmt":"2015-12-07T03:41:51","guid":{"rendered":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?p=2321"},"modified":"2023-08-11T12:30:24","modified_gmt":"2023-08-11T11:30:24","slug":"how-to-add-a-wildcard-dns-record","status":"publish","type":"post","link":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/","title":{"rendered":"How to add a wildcard DNS record?"},"content":{"rendered":"<p>Wildcard DNS works in such a way, that any subdomain redirects to your primary domain.<\/p>\n<p>For example, when set, anyone typing subtest.mydomain.com or subtest123.mydomain.com will be redirected to mydomain.com.<\/p>\n<p>It is also used to redirect queries like <strong>ww<\/strong>.mydomain.com to <strong>www<\/strong>.mydomain.com, where ww is wrongly typed.<\/p>\n<p>WildCard subdomains can be set by&nbsp;either of the three ways:<\/p>\n<p>1.&nbsp;Setting it from <strong>cPanel<\/strong><\/p>\n<p>2. Setting it from <strong>WHM<\/strong><\/p>\n<p>3. Setting it from <strong>httpd.conf<\/strong><\/p>\n<p><em><strong>1.&nbsp;Setting it from cPanel<\/strong><\/em><\/p>\n<p>a. Log into your cPanel<\/p>\n<p>b. Go to Subdomains<\/p>\n<p>c. Add subdomain * in the box next to the field &#8216;<b>Subdomain&#8217;&nbsp;<\/b>of your primary domain. Make sure that the Document Root is set to <strong>public_html <\/strong>folder.<\/p>\n<p>While adding Wildcard subdomain to your Addon domain, you just need to be sure to set the Document Root to that of the Addon Domain and not the primary domain.<\/p>\n<p><em><strong>2. Setting it from WHM<\/strong><\/em><\/p>\n<p>If you have access to WHM, then you need to<\/p>\n<p>a. Go to <strong>Edit DNS Zone<\/strong><\/p>\n<p>b. Select the required domain<\/p>\n<p>c. Under&nbsp;<strong>Add New Entries Below this Line&nbsp;<\/strong>insert as below<\/p>\n<p><a href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2324\" src=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-300x23.png\" alt=\"wildcarddns\" width=\"522\" height=\"40\" srcset=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-300x23.png 300w, https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-50x4.png 50w, https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns.png 875w\" sizes=\"auto, (max-width: 522px) 100vw, 522px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>NOTE: Please replace 20.x.xx.xx with the actual IP of the account.<\/p>\n<p><em><strong>3. Setting it from httpd.conf<\/strong><\/em><\/p>\n<p><strong>&nbsp;<\/strong>In order to use this method, you need root access to the server.<\/p>\n<p>a. Login as root<\/p>\n<p>b. Edit <strong>httpd.conf &nbsp;<\/strong>(commonly located at \/etc\/httpd\/conf)&nbsp;with your favorite text editor such as Vim or Nano and go to the VirtualHost entry of the domain\/website.<\/p>\n<p><em>&lt;VirtualHost 20.x.xx.xxx:80&gt;<\/em><br \/>\n<em> ServerName&nbsp;mydomain.com<\/em><br \/>\n<strong><em> ServerAlias www.mydomain.com<\/em><\/strong><br \/>\n<em> DocumentRoot \/home\/mydomain\/public_html<\/em><br \/>\n<em> ServerAdmin webmaster@mydomain.com<\/em><br \/>\n<em> UseCanonicalName Off<\/em><br \/>\n<em> CustomLog \/usr\/local\/apache\/domlogs\/mydomain.com combined<\/em><br \/>\n<em> CustomLog \/usr\/local\/apache\/domlogs\/mydomain.com-bytes_log &#8220;%{%s}t %I .\\n%{%s}t %O .&#8221;<\/em><\/p>\n<p>c. The line&nbsp;<strong><em>ServerAlias www.mydomain.com&nbsp;<\/em><\/strong>is of your interest. Simply replace<em>&nbsp;<strong>www&nbsp;<\/strong><\/em>with <em><strong>* <\/strong><\/em>which should look like&nbsp;<strong><em>ServerAlias <\/em><em>*<\/em><em>.mydomain.com<\/em><\/strong><\/p>\n<p><em>That&#8217;s it !<\/em><\/p>\n<p><span style=\"border-radius: 2px; text-indent: 20px; width: auto; padding: 0px 4px 0px 0px; text-align: center; font: bold 11px\/20px 'Helvetica Neue',Helvetica,sans-serif; color: #ffffff; background: #bd081c  no-repeat scroll 3px 50% \/ 14px 14px; position: absolute; opacity: 1; z-index: 8675309; display: none; cursor: pointer;\">Save<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wildcard DNS works in such a way, that any subdomain redirects to your primary domain. For example, when set, anyone typing subtest.mydomain.com or subtest123.mydomain.com will be redirected to mydomain.com. It is also used to redirect queries like ww.mydomain.com to www.mydomain.com, where ww is wrongly typed. WildCard subdomains can be set by&nbsp;either of the three ways: [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2321","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-domain-name-dns-issues"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to add a wildcard DNS record?<\/title>\n<meta name=\"description\" content=\"Master the art of adding a wildcard DNS record with step-by-step instructions. Set up wildcard DNS and efficiently manage dynamic subdomain creation.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to add a wildcard DNS record?\" \/>\n<meta property=\"og:description\" content=\"Master the art of adding a wildcard DNS record with step-by-step instructions. Set up wildcard DNS and efficiently manage dynamic subdomain creation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-07T03:41:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-11T11:30:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-300x23.png\" \/>\n<meta name=\"author\" content=\"Amol Naik\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Amol Naik\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/\",\"name\":\"How to add a wildcard DNS record?\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-300x23.png\",\"datePublished\":\"2015-12-07T03:41:51+00:00\",\"dateModified\":\"2023-08-11T11:30:24+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3\"},\"description\":\"Master the art of adding a wildcard DNS record with step-by-step instructions. Set up wildcard DNS and efficiently manage dynamic subdomain creation.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#primaryimage\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns.png\",\"contentUrl\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns.png\",\"width\":875,\"height\":66},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to add a wildcard DNS record?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3\",\"name\":\"Amol Naik\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/13a3e28954a5682af8b75e7135575b72?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/13a3e28954a5682af8b75e7135575b72?s=96&d=blank&r=g\",\"caption\":\"Amol Naik\"},\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/amol\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to add a wildcard DNS record?","description":"Master the art of adding a wildcard DNS record with step-by-step instructions. Set up wildcard DNS and efficiently manage dynamic subdomain creation.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/","og_locale":"en_GB","og_type":"article","og_title":"How to add a wildcard DNS record?","og_description":"Master the art of adding a wildcard DNS record with step-by-step instructions. Set up wildcard DNS and efficiently manage dynamic subdomain creation.","og_url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2015-12-07T03:41:51+00:00","article_modified_time":"2023-08-11T11:30:24+00:00","og_image":[{"url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-300x23.png","type":"","width":"","height":""}],"author":"Amol Naik","twitter_misc":{"Written by":"Amol Naik","Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/","name":"How to add a wildcard DNS record?","isPartOf":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#primaryimage"},"image":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-300x23.png","datePublished":"2015-12-07T03:41:51+00:00","dateModified":"2023-08-11T11:30:24+00:00","author":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3"},"description":"Master the art of adding a wildcard DNS record with step-by-step instructions. Set up wildcard DNS and efficiently manage dynamic subdomain creation.","breadcrumb":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#primaryimage","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns.png","contentUrl":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns.png","width":875,"height":66},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How to add a wildcard DNS record?"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3","name":"Amol Naik","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/13a3e28954a5682af8b75e7135575b72?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/13a3e28954a5682af8b75e7135575b72?s=96&d=blank&r=g","caption":"Amol Naik"},"url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/amol\/"}]}},"views":1494,"_links":{"self":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/2321","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=2321"}],"version-history":[{"count":12,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/2321\/revisions"}],"predecessor-version":[{"id":14962,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/2321\/revisions\/14962"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=2321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=2321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=2321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}