{"id":1899,"date":"2021-05-31T15:35:19","date_gmt":"2021-05-31T12:35:19","guid":{"rendered":"https:\/\/www.scalahosting.com\/kb\/?p=1899"},"modified":"2022-06-05T15:58:52","modified_gmt":"2022-06-05T12:58:52","slug":"add-a-cname-record","status":"publish","type":"post","link":"https:\/\/www.scalahosting.com\/kb\/add-a-cname-record\/","title":{"rendered":"Add a CNAME record"},"content":{"rendered":"\n<p><span style=\"font-weight: 400;\">A CNAME record is a <\/span><a href=\"https:\/\/www.scalahosting.com\/kb\/dns-records-explained\/\"><b>DNS record<\/b><\/a><b> that turns one domain<\/b> <i><span style=\"font-weight: 400;\">(usually a subdomain)<\/span><\/i><span style=\"font-weight: 400;\"> into an alias for another. To show you how it works, we&#8217;ll look at its most common application \u2013 <\/span><b>mapping the www. subdomain to the primary domain.<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">First, a user enters<\/span> <b>www.domain.com<\/b><span style=\"font-weight: 400;\"> into their browser. The browser sends a request to the DNS resolver and is relayed to the <\/span><b>Authoritative Name Server<\/b><span style=\"font-weight: 400;\"> that hosts domain.com&#8217;s DNS zone file. Then, the server responds with the <\/span><b>stored CNAME record.\u00a0<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">The browser understands that it needs to look for domain.com and <\/span><b>puts together a second DNS request,<\/b><span style=\"font-weight: 400;\"> eventually resolving to the correct IP.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">It&#8217;s important to make the <\/span><b>distinction between a CNAME record and a redirect.<\/b><span style=\"font-weight: 400;\"> A redirect reroutes the traffic to a predetermined destination. The goal of the CNAME is to lead the user to the<\/span><b> correct IP address.<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">You can have a<\/span><b> CNAME record<\/b><span style=\"font-weight: 400;\"> for blog.domain.com that points to domain.com, but this doesn&#8217;t necessarily mean that the two will display the same content.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">If it is<\/span><b> configured correctly,<\/b><span style=\"font-weight: 400;\"> blog.domain.com will lead users to the server&#8217;s IP address, and the web server will serve them the blog section of your website rather than the homepage. CNAME records can be <\/span><b>very useful in many scenarios.<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">For example, suppose all your <\/span><a href=\"https:\/\/www.scalahosting.com\/kb\/how-to-create-a-subdomain\/\"><b>subdomains<\/b><\/a> <i><span style=\"font-weight: 400;\">(blog.domain.com, shop.domain.com, mail.domain.com, ftp.domain.com, etc.)<\/span><\/i><span style=\"font-weight: 400;\"> are mapped to domain.com, and domain.com has an <\/span><b>A record <\/b><span style=\"font-weight: 400;\">pointing it to the server&#8217;s IP.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">If you ever need to <\/span><b>move the website to a different server,<\/b><span style=\"font-weight: 400;\"> all you&#8217;ll need to do is change domain.com&#8217;s A record. It will save you a lot of time reconfiguring every individual subdomain one by one.<\/span><\/p>\n\n\n\n<p><b>There are a couple of restrictions you need to bear in mind when setting CNAME records:<\/b><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You can&#8217;t place a CNAME record at the<\/span><b> root domain level<\/b> <i><span style=\"font-weight: 400;\">(domain.com).<\/span><\/i><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">CNAME records can only point to other domain names and never to IP addresses.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You can&#8217;t place a CNAME record for a hostname with other DNS records like A records, NS records, etc.<\/span><i><span style=\"font-weight: 400;\"> (with the exception of DNSSEC records).<\/span><\/i><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">It is possible to point one CNAME record to another, but this is not considered a good practice, as it<\/span><b> affects performance due to the increased number of DNS requests<\/b><span style=\"font-weight: 400;\">.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">MX and NS records can&#8217;t point to CNAME aliases.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Domains used for email can&#8217;t act as <\/span><b>CNAME aliases.<\/b><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><b>Setting a CNAME record on your ScalaHosting account<\/b><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">After you point your domain to your <\/span><b>ScalaHosting account<\/b><span style=\"font-weight: 400;\">, our servers are responsible for hosting your DNS zone file. Both <\/span><a href=\"https:\/\/www.scalahosting.com\/blog\/cloud-hosting\/\"><b>cPanel<\/b><\/a><span style=\"font-weight: 400;\"> and <\/span><a href=\"https:\/\/www.scalahosting.com\/spanel.html\"><b>SPanel<\/b><\/a><span style=\"font-weight: 400;\"> let you edit it through an easy-to-use Graphical User Interface (GUI). Here are the exact steps.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><b>SPanel<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">SPanel&#8217;s tool for <\/span><b>editing your domain&#8217;s DNS zone <\/b><span style=\"font-weight: 400;\">is available on the User Interface homepage.<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"840\" height=\"152\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/dns-editor-spanel.png\" alt=\"Add a CNAME record, SPanel\" class=\"wp-image-1900\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/dns-editor-spanel.png 840w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/dns-editor-spanel-300x54.png 300w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/dns-editor-spanel-768x139.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure>\n<\/div>\n\n\n<p><span style=\"font-weight: 400;\">At the top of the page, you have a<\/span><b> drop-down menu<\/b><span style=\"font-weight: 400;\"> from which you can pick the domain you&#8217;d like to edit. At the bottom, there&#8217;s a list of all the DNS records currently <\/span><b>set for the chosen domain.&nbsp;<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">You should be able to see that there&#8217;s already a CNAME record for the www. subdomain that <\/span><b>points to your primary website<\/b><span style=\"font-weight: 400;\">. It&#8217;s there by default.<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1903\" height=\"1468\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/add-cname-spanel.png\" alt=\"Add a CNAME record, SPanel 2\" class=\"wp-image-1901\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/add-cname-spanel.png 1903w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/add-cname-spanel-300x231.png 300w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/add-cname-spanel-1024x790.png 1024w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/add-cname-spanel-768x592.png 768w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/add-cname-spanel-1536x1185.png 1536w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure>\n<\/div>\n\n\n<p><span style=\"font-weight: 400;\">Between the <\/span><b>Choose a domain to edit <\/b><span style=\"font-weight: 400;\">drop-down and the list of existing records, you have the form for adding new DNS records.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">To add a new CNAME record, you<\/span><b> first need to enter the alias.<\/b><span style=\"font-weight: 400;\"> Bear in mind that if the new alias is a <\/span><b>subdomain of the primary domain<\/b><span style=\"font-weight: 400;\">, you only need to add the first section<\/span><i><span style=\"font-weight: 400;\"> (i.e., if you want to create a CNAME record for blog.domain.com, you only need to enter blog in the <\/span><\/i><b><i>Name <\/i><\/b><i><span style=\"font-weight: 400;\">field).<\/span><\/i><\/p>\n\n\n\n<p><b>TTL <\/b><span style=\"font-weight: 400;\">is short for <\/span><b>Time to Live<\/b><span style=\"font-weight: 400;\">. It&#8217;s a setting that determines how long information on the record will stay in the DNS resolver&#8217;s cache before a new request is required. By default, it&#8217;s set at <\/span><b>14,400 seconds or 4 hours<\/b><span style=\"font-weight: 400;\"> \u2013 a good compromise between quick propagation times and decent performance.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">From the <\/span><b>Type<\/b><span style=\"font-weight: 400;\"> drop-down, you need to pick <\/span><b>CNAME<\/b><span style=\"font-weight: 400;\">.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Finally, in the <\/span><b>Value<\/b><span style=\"font-weight: 400;\"> field, you have to enter where the new CNAME record will be pointing to.<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1275\" height=\"330\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/cname-record-spanel.png\" alt=\"Add a CNAME record, SPanel 3\" class=\"wp-image-1902\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/cname-record-spanel.png 1275w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/cname-record-spanel-300x78.png 300w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/cname-record-spanel-1024x265.png 1024w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/cname-record-spanel-768x199.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure>\n<\/div>\n\n\n<p><span style=\"font-weight: 400;\">After you&#8217;re ready, you can click <\/span><b>Add Record<\/b><span style=\"font-weight: 400;\"> to save the new record. Bear in mind that changes to the domain&#8217;s DNS settings need some time to propagate throughout the world, so the modifications might not be immediately visible.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><b>cPanel<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">cPanel&#8217;s <\/span><b>DNS Zone Editor<\/b><span style=\"font-weight: 400;\"> is available on the control panel&#8217;s homepage.<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1371\" height=\"191\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/cpanel-zone-editor.png\" alt=\"Add a CNAME record, cPanel\" class=\"wp-image-1903\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/cpanel-zone-editor.png 1371w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/cpanel-zone-editor-300x42.png 300w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/cpanel-zone-editor-1024x143.png 1024w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/cpanel-zone-editor-768x107.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure>\n<\/div>\n\n\n<p><span style=\"font-weight: 400;\">Its interface is a bit different from what SPanel offers. You have the<\/span><b> list of all the domains <\/b><span style=\"font-weight: 400;\">you&#8217;ve added to your <\/span><b>cPanel account,<\/b><span style=\"font-weight: 400;\"> along with buttons for adding the most common DNS records.<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1475\" height=\"260\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/add-cname-cpanel.png\" alt=\"Add a CNAME record, cPanel 2\" class=\"wp-image-1904\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/add-cname-cpanel.png 1475w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/add-cname-cpanel-300x53.png 300w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/add-cname-cpanel-1024x181.png 1024w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/add-cname-cpanel-768x135.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure>\n<\/div>\n\n\n<p><span style=\"font-weight: 400;\">The <\/span><b>CNAME<\/b> <b>Record<\/b><span style=\"font-weight: 400;\"> button opens up a pop-up requesting the CNAME alias and the record&#8217;s value.<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"522\" height=\"291\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/cname-record-cpanel.png\" alt=\"Add a CNAME record, cPanel 3\" class=\"wp-image-1905\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/cname-record-cpanel.png 522w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/cname-record-cpanel-300x167.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure>\n<\/div>\n\n\n<p><span style=\"font-weight: 400;\">After you enter the requested information, you need to click <\/span><b>Add A CNAME Record<\/b><span style=\"font-weight: 400;\"> to complete the process.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A CNAME record is a DNS record that turns one domain (usually a subdomain) into an alias for another. To show you how it works, we&#8217;ll look at its most common application \u2013 mapping the www. subdomain to the primary domain. First, a user enters www.domain.com into their browser. The browser sends a request to [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":""},"categories":[22],"tags":[],"class_list":["post-1899","post","type-post","status-publish","format-standard","hentry","category-dns"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/1899","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/comments?post=1899"}],"version-history":[{"count":4,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/1899\/revisions"}],"predecessor-version":[{"id":4806,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/1899\/revisions\/4806"}],"wp:attachment":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/media?parent=1899"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/categories?post=1899"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/tags?post=1899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}