{"id":59,"date":"2020-06-03T11:35:20","date_gmt":"2020-06-03T10:35:20","guid":{"rendered":"http:\/\/kbnco.names.dev.pdunsford.localdev\/?post_type=ht_kb&amp;p=59"},"modified":"2020-06-03T11:35:20","modified_gmt":"2020-06-03T10:35:20","slug":"how-to-update-your-hosts-file","status":"publish","type":"ht_kb","link":"https:\/\/www.names.co.uk\/support\/articles\/how-to-update-your-hosts-file\/","title":{"rendered":"How to update your hosts file"},"content":{"rendered":"\n<p>This article will demonstrate how you can update your Hosts file on both Windows and Mac to preview your site before making any DNS changes.<\/p>\n\n\n\n<p>Changing the local hosts file on your computer is an extremely useful tool that will allow you to view your website hosted on a specific server address, without the need to update the DNS for the domain. This is particularly useful when migrating your site from one provider to another, as you will be able to view the new website on your computer, whilst everybody else will still see the old website.<img decoding=\"async\" alt=\"windows 10\" src=\"\/support\/wp-content\/uploads\/2020\/09\/windows10.png\"><\/p>\n\n\n\n<p>Firstly, you will need to open the application&nbsp;<strong>Notepad<\/strong>&nbsp;as an&nbsp;<strong>Administrator.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/2020\/09\/notepad1.png\" alt=\"open notepad as an administrator\" title=\"open notepad as an administrator\"\/><\/figure>\n\n\n\n<p>Next you will need to click&nbsp;<strong>File &gt; Open.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/2020\/09\/File-Open.png\" alt=\"notepad file and open\" title=\"notepad file and open\"\/><\/figure>\n\n\n\n<p>At the top of the window, search for&nbsp;<strong>C:\\Windows\\System32\\drivers\\etc<\/strong>&nbsp;and hit Enter on your keyboard.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/2020\/09\/Searchfolderstructure.png\" alt=\"search folder structure\" title=\"search folder structure\"\/><\/figure>\n\n\n\n<p>Then change the displayed file types from&nbsp;<strong>Text Documents<\/strong>&nbsp;to&nbsp;<strong>All Files.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/2020\/09\/selectallfiles.png\" alt=\"select all files\" title=\"select all files\"\/><\/figure>\n\n\n\n<p>Click on the file called&nbsp;<strong>Hosts<\/strong>, and then click&nbsp;<strong>Open<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/2020\/09\/openhosts.png\" alt=\"open hosts file\" title=\"open hosts file\"\/><\/figure>\n\n\n\n<p>Underneath all of the text in the file, simply enter the IP address for your hosting followed by the name of your website.<\/p>\n\n\n\n<p><strong>Apache &#8211; Use 85.233.160.145<br>cPanel &#8211; Use your cPanel IP address<br>Windows &#8211; Use 81.88.60.34<\/strong><\/p>\n\n\n\n<p>We would recommend that you enter two separate lines for both your primary domain and your www subdomain, as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/2020\/09\/edithosts.png\" alt=\"edit hosts file\" title=\"edit hosts file\"\/><\/figure>\n\n\n\n<p>Once you have applied the correct changes, click&nbsp;<strong>File<\/strong>&nbsp;and&nbsp;<strong>Save<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/2020\/09\/savehostsfile.png\" alt=\"save hosts file\" title=\"save hosts file\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/2020\/09\/macoslogo.png\" alt=\"macOS logo\" title=\"macOS logo\"\/><\/figure>\n\n\n\n<p>Within a new Finder window, click on&nbsp;<strong>Applications<\/strong>&nbsp;and then double click on the&nbsp;<strong>Utilities<\/strong>&nbsp;folder.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/2020\/09\/1_mac2.png\" alt=\"open utilities folder\" title=\"open utilities folder\"\/><\/figure>\n\n\n\n<p>Next, double click on&nbsp;<strong>Terminal<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/2020\/09\/1_mac3.png\" alt=\"open terminal\" title=\"open terminal\"\/><\/figure>\n\n\n\n<p>Within Terminal, enter the following command:<br><br><strong>sudo nano \/etc\/hosts<\/strong><br><br>and hit return on your keyboard.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/2020\/09\/mac4.png\" alt=\"enter command into terminal\" title=\"enter command into terminal\"\/><\/figure>\n\n\n\n<p>You will then need to enter your Mac&#8217;s&nbsp;<strong>Administrator Password<\/strong>, and hit return.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/2020\/09\/mac5.png\" alt=\"enter mac password\" title=\"enter mac password\"\/><\/figure>\n\n\n\n<p>Underneath all of the text in the file, simply enter the IP address for your hosting followed by the name of your website.<\/p>\n\n\n\n<p><strong>Apache &#8211; Use 85.233.160.145<br>cPanel &#8211; Use your cPanel IP address<br>Windows &#8211; Use 81.88.60.34<\/strong><\/p>\n\n\n\n<p>We would recommend that you enter two separate lines for both your primary domain and your www subdomain, as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/2020\/09\/mac6.png\" alt=\"enter domain and IP address\" title=\"enter domain and IP address\"\/><\/figure>\n\n\n\n<p>In order to save the file, hold&nbsp;<strong>control<\/strong>&nbsp;and&nbsp;<strong>O<\/strong>&nbsp;on your keyboard.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article will demonstrate how you can update your Hosts file on both Windows and Mac to preview your site before making any DNS changes. Changing the local hosts file on your computer is an extremely useful tool that will allow you to view your website hosted on a specific server address, without the need [&hellip;]<\/p>\n","protected":false},"author":2,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[119],"ht-kb-tag":[110,120],"class_list":["post-59","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-hosting","ht_kb_tag-dns","ht_kb_tag-hosting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to update your hosts file - Support Centre - names.co.uk<\/title>\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.names.co.uk\/support\/articles\/how-to-update-your-hosts-file\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to update your hosts file - Support Centre - names.co.uk\" \/>\n<meta property=\"og:description\" content=\"This article will demonstrate how you can update your Hosts file on both Windows and Mac to preview your site before making any DNS changes. Changing the local hosts file on your computer is an extremely useful tool that will allow you to view your website hosted on a specific server address, without the need [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.names.co.uk\/support\/articles\/how-to-update-your-hosts-file\/\" \/>\n<meta property=\"og:site_name\" content=\"Support Centre - names.co.uk\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/namesco\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.names.co.uk\/support\/wp-content\/uploads\/2020\/09\/windows10.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@namesco\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.names.co.uk\/support\/articles\/how-to-update-your-hosts-file\/\",\"url\":\"https:\/\/www.names.co.uk\/support\/articles\/how-to-update-your-hosts-file\/\",\"name\":\"How to update your hosts file - Support Centre - names.co.uk\",\"isPartOf\":{\"@id\":\"https:\/\/www.names.co.uk\/support\/#website\"},\"datePublished\":\"2020-06-03T10:35:20+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.names.co.uk\/support\/articles\/how-to-update-your-hosts-file\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.names.co.uk\/support\/articles\/how-to-update-your-hosts-file\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.names.co.uk\/support\/articles\/how-to-update-your-hosts-file\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.names.co.uk\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to update your hosts file\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.names.co.uk\/support\/#website\",\"url\":\"https:\/\/www.names.co.uk\/support\/\",\"name\":\"Support Centre - names.co.uk\",\"description\":\"names.co.uk Support Centre\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.names.co.uk\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to update your hosts file - Support Centre - names.co.uk","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.names.co.uk\/support\/articles\/how-to-update-your-hosts-file\/","og_locale":"en_GB","og_type":"article","og_title":"How to update your hosts file - Support Centre - names.co.uk","og_description":"This article will demonstrate how you can update your Hosts file on both Windows and Mac to preview your site before making any DNS changes. Changing the local hosts file on your computer is an extremely useful tool that will allow you to view your website hosted on a specific server address, without the need [&hellip;]","og_url":"https:\/\/www.names.co.uk\/support\/articles\/how-to-update-your-hosts-file\/","og_site_name":"Support Centre - names.co.uk","article_publisher":"https:\/\/www.facebook.com\/namesco","og_image":[{"url":"https:\/\/www.names.co.uk\/support\/wp-content\/uploads\/2020\/09\/windows10.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_site":"@namesco","twitter_misc":{"Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.names.co.uk\/support\/articles\/how-to-update-your-hosts-file\/","url":"https:\/\/www.names.co.uk\/support\/articles\/how-to-update-your-hosts-file\/","name":"How to update your hosts file - Support Centre - names.co.uk","isPartOf":{"@id":"https:\/\/www.names.co.uk\/support\/#website"},"datePublished":"2020-06-03T10:35:20+00:00","breadcrumb":{"@id":"https:\/\/www.names.co.uk\/support\/articles\/how-to-update-your-hosts-file\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.names.co.uk\/support\/articles\/how-to-update-your-hosts-file\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.names.co.uk\/support\/articles\/how-to-update-your-hosts-file\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.names.co.uk\/support\/"},{"@type":"ListItem","position":2,"name":"How to update your hosts file"}]},{"@type":"WebSite","@id":"https:\/\/www.names.co.uk\/support\/#website","url":"https:\/\/www.names.co.uk\/support\/","name":"Support Centre - names.co.uk","description":"names.co.uk Support Centre","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.names.co.uk\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"}]}},"_links":{"self":[{"href":"https:\/\/www.names.co.uk\/support\/wp-json\/wp\/v2\/ht-kb\/59","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.names.co.uk\/support\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.names.co.uk\/support\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.names.co.uk\/support\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.names.co.uk\/support\/wp-json\/wp\/v2\/comments?post=59"}],"version-history":[{"count":0,"href":"https:\/\/www.names.co.uk\/support\/wp-json\/wp\/v2\/ht-kb\/59\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.names.co.uk\/support\/wp-json\/wp\/v2\/media?parent=59"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.names.co.uk\/support\/wp-json\/wp\/v2\/ht-kb-category?post=59"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.names.co.uk\/support\/wp-json\/wp\/v2\/ht-kb-tag?post=59"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}