{"id":2321,"date":"2015-12-07T03:41:51","date_gmt":"2015-12-07T03:41:51","guid":{"rendered":"https:\/\/www.milesweb.com\/hosting-faqs\/?p=2321"},"modified":"2018-05-26T05:14:45","modified_gmt":"2018-05-26T05:14:45","slug":"how-to-add-a-wildcard-dns-record","status":"publish","type":"post","link":"https:\/\/www.milesweb.in\/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\u00a0either of the three ways:<\/p>\n<p>1.\u00a0Setting 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.\u00a0Setting 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;\u00a0<\/b>of your primary domain. Make sure that the Document Root is set to <strong>public_html <\/strong>folder.<\/p>\n<p><strong>Related:\u00a0<a href=\"https:\/\/www.milesweb.in\/hosting-faqs\/complete-guide-wildcard-certificates\/\">A Complete Guide to Wildcard Certificates<\/a><\/strong><\/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\u00a0<strong>Add New Entries Below this Line\u00a0<\/strong>insert as below<\/p>\n<p><a href=\"https:\/\/www.milesweb.com\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2324\" src=\"https:\/\/www.milesweb.com\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-300x23.png\" alt=\"wildcarddns\" width=\"522\" height=\"40\" srcset=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-300x23.png 300w, https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-50x4.png 50w, https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns.png 875w\" sizes=\"auto, (max-width: 522px) 100vw, 522px\" \/><\/a><\/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>\u00a0<\/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 \u00a0<\/strong>(commonly located at \/etc\/httpd\/conf)\u00a0with 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\u00a0mydomain.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\u00a0<strong><em>ServerAlias www.mydomain.com\u00a0<\/em><\/strong>is of your interest. Simply replace<em>\u00a0<strong>www\u00a0<\/strong><\/em>with <em><strong>* <\/strong><\/em>which should look like\u00a0<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\u00a0either 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 v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How To Add A Wildcard DNS Record?<\/title>\n<meta name=\"description\" content=\"Wildcard DNS works in such a way, that any subdomain redirects to your primary domain.\" \/>\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.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\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=\"Wildcard DNS works in such a way, that any subdomain redirects to your primary domain.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.in\/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=\"2018-05-26T05:14:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.milesweb.com\/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=\"Est. 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\":\"Article\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/\"},\"author\":{\"name\":\"Amol Naik\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3\"},\"headline\":\"How To Add A Wildcard DNS Record?\",\"datePublished\":\"2015-12-07T03:41:51+00:00\",\"dateModified\":\"2018-05-26T05:14:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/\"},\"wordCount\":336,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.milesweb.com\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-300x23.png\",\"articleSection\":[\"Domain Name &amp; DNS Issues\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/\",\"name\":\"How To Add A Wildcard DNS Record?\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.milesweb.com\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-300x23.png\",\"datePublished\":\"2015-12-07T03:41:51+00:00\",\"dateModified\":\"2018-05-26T05:14:45+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3\"},\"description\":\"Wildcard DNS works in such a way, that any subdomain redirects to your primary domain.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#primaryimage\",\"url\":\"https:\/\/www.milesweb.com\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-300x23.png\",\"contentUrl\":\"https:\/\/www.milesweb.com\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-300x23.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Add A Wildcard DNS Record?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3\",\"name\":\"Amol Naik\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/051d93e0548382a233b8a429b0813076888d5f179b4297089ac7ca9ed9c75bfb?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/051d93e0548382a233b8a429b0813076888d5f179b4297089ac7ca9ed9c75bfb?s=96&d=blank&r=g\",\"caption\":\"Amol Naik\"},\"sameAs\":[\"https:\/\/www.milesweb.com\/\"],\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/author\/amol\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Add A Wildcard DNS Record?","description":"Wildcard DNS works in such a way, that any subdomain redirects to your primary domain.","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.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/","og_locale":"en_US","og_type":"article","og_title":"How To Add A Wildcard DNS Record?","og_description":"Wildcard DNS works in such a way, that any subdomain redirects to your primary domain.","og_url":"https:\/\/www.milesweb.in\/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":"2018-05-26T05:14:45+00:00","og_image":[{"url":"https:\/\/www.milesweb.com\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-300x23.png","type":"","width":"","height":""}],"author":"Amol Naik","twitter_misc":{"Written by":"Amol Naik","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#article","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/"},"author":{"name":"Amol Naik","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3"},"headline":"How To Add A Wildcard DNS Record?","datePublished":"2015-12-07T03:41:51+00:00","dateModified":"2018-05-26T05:14:45+00:00","mainEntityOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/"},"wordCount":336,"commentCount":0,"image":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.com\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-300x23.png","articleSection":["Domain Name &amp; DNS Issues"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/","name":"How To Add A Wildcard DNS Record?","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#primaryimage"},"image":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.com\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-300x23.png","datePublished":"2015-12-07T03:41:51+00:00","dateModified":"2018-05-26T05:14:45+00:00","author":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3"},"description":"Wildcard DNS works in such a way, that any subdomain redirects to your primary domain.","breadcrumb":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#primaryimage","url":"https:\/\/www.milesweb.com\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-300x23.png","contentUrl":"https:\/\/www.milesweb.com\/hosting-faqs\/wp-content\/uploads\/2015\/12\/wildcarddns-300x23.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-add-a-wildcard-dns-record\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.in\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How To Add A Wildcard DNS Record?"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.in\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3","name":"Amol Naik","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/051d93e0548382a233b8a429b0813076888d5f179b4297089ac7ca9ed9c75bfb?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/051d93e0548382a233b8a429b0813076888d5f179b4297089ac7ca9ed9c75bfb?s=96&d=blank&r=g","caption":"Amol Naik"},"sameAs":["https:\/\/www.milesweb.com\/"],"url":"https:\/\/www.milesweb.in\/hosting-faqs\/author\/amol\/"}]}},"_links":{"self":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/2321","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=2321"}],"version-history":[{"count":14,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/2321\/revisions"}],"predecessor-version":[{"id":5192,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/2321\/revisions\/5192"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=2321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=2321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=2321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}