{"id":6986,"date":"2016-09-05T09:47:26","date_gmt":"2016-09-05T14:47:26","guid":{"rendered":"http:\/\/www.highclouder.com\/?p=6986"},"modified":"2024-05-21T14:49:54","modified_gmt":"2024-05-21T14:49:54","slug":"using-hosts-file-register-dns-c-name","status":"publish","type":"post","link":"https:\/\/www.highclouder.com\/?p=6986","title":{"rendered":"Using Hosts File to Register DNS C-Name"},"content":{"rendered":"<p>Many of us are using the <strong>HOSTS<\/strong> file for ages. However, not many people know about this \u201cfeature\u201d.<\/p>\n<p>So let\u2019s see how it works. Often we use the hosts file to test new implementations, changes to an existing system and so on. During Office 365 implementations we need to have some C-Name record, so how do we test that by using just hosts files before we do any real DNS changes?<!--more--><\/p>\n<p>Apparently, it&#8217;s very simple. I am sure, you know the location of the host file :), so open it in your favourite editor and edit it according to the following example:<\/p>\n<pre>52.33.59.94\ta-record.highclouder.com\tc-name.highclouder.com<\/pre>\n<p>So, now, when we will run the following command:<\/p>\n<pre>ping c-name.highclouder.com -n 1<\/pre>\n<p>We will see the following result:<br \/>\n<a href=\"http:\/\/dev.highclouder.com\/wp-content\/uploads\/2016\/09\/C-NAME_in_HOSTS_File-1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/dev.highclouder.com\/wp-content\/uploads\/2016\/09\/C-NAME_in_HOSTS_File-1.jpg\" alt=\"C-NAME in The HOSTS File-1\" width=\"760\" height=\"276\" class=\"aligncenter size-full wp-image-6987\" srcset=\"https:\/\/www.highclouder.com\/wp-content\/uploads\/2016\/09\/C-NAME_in_HOSTS_File-1.jpg 760w, https:\/\/www.highclouder.com\/wp-content\/uploads\/2016\/09\/C-NAME_in_HOSTS_File-1-300x109.jpg 300w\" sizes=\"auto, (max-width: 760px) 100vw, 760px\" \/><\/a><\/p>\n<p>Now, for let\u2019s say test <strong>Autodiscover<\/strong>, we can put the following line in the host file:<\/p>\n<pre>132.245.22.248\tautodiscover.outlook.com\tautodiscover.highclouder.com<\/pre>\n<p>And here is an expected result:<br \/>\n<a href=\"http:\/\/dev.highclouder.com\/wp-content\/uploads\/2016\/09\/C-NAME_in_HOSTS_File-2.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/dev.highclouder.com\/wp-content\/uploads\/2016\/09\/C-NAME_in_HOSTS_File-2.jpg\" alt=\"C-NAME_in_HOSTS_File-2\" width=\"760\" height=\"293\" class=\"aligncenter size-full wp-image-6988\" srcset=\"https:\/\/www.highclouder.com\/wp-content\/uploads\/2016\/09\/C-NAME_in_HOSTS_File-2.jpg 760w, https:\/\/www.highclouder.com\/wp-content\/uploads\/2016\/09\/C-NAME_in_HOSTS_File-2-300x116.jpg 300w\" sizes=\"auto, (max-width: 760px) 100vw, 760px\" \/><\/a><\/p>\n<p>I hope that you learned something new and that you benefit from this post. Feel free to <a href=\"https:\/\/www.highclouder.com\/contact-me\/\" target=\"_blank\" rel=\"noopener\">contact me<\/a> if you want to discuss anything else.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Many of us are using the HOSTS file for ages. However, not many people know about this \u201cfeature\u201d. So let\u2019s see how it works. Often we use the hosts file to test new implementations, changes to an existing system and so on. During Office 365 implementations we need to have some C-Name record, so how [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6990,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[17,46,16],"class_list":["post-6986","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-autodiscover","tag-dns","tag-office-365"],"_links":{"self":[{"href":"https:\/\/www.highclouder.com\/index.php?rest_route=\/wp\/v2\/posts\/6986","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.highclouder.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.highclouder.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.highclouder.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.highclouder.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6986"}],"version-history":[{"count":1,"href":"https:\/\/www.highclouder.com\/index.php?rest_route=\/wp\/v2\/posts\/6986\/revisions"}],"predecessor-version":[{"id":7241,"href":"https:\/\/www.highclouder.com\/index.php?rest_route=\/wp\/v2\/posts\/6986\/revisions\/7241"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.highclouder.com\/index.php?rest_route=\/wp\/v2\/media\/6990"}],"wp:attachment":[{"href":"https:\/\/www.highclouder.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.highclouder.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.highclouder.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}