{"id":106,"date":"2014-07-06T14:01:20","date_gmt":"2014-07-06T12:01:20","guid":{"rendered":"http:\/\/servikus.com\/tutorials\/?p=106"},"modified":"2014-08-20T16:10:03","modified_gmt":"2014-08-20T14:10:03","slug":"changing-etchosts-file","status":"publish","type":"post","link":"https:\/\/servikus.com\/tutorials\/changing-etchosts-file\/","title":{"rendered":"How to change \/etc\/hosts file"},"content":{"rendered":"<p>When you get our mail with login details you still cannot see your site. This is because you need to change Nameservers. Even when you change them you need to wait as long as 24-48 hours for propagation. If you want to see you site before that and <strong>especially if you want to check if it works as it should (if you already have working site) before changing NSs<\/strong> you need to change <strong>etc\/hosts<\/strong> file. We\u2019ll show you how you can do that in Windows 7 OS (other Windows versions differs slightly) and also in Linux.<\/p>\n<h2>Windows 7<\/h2>\n<p>Open <strong>Computer<\/strong> and in address bar navigate to <strong>C:\\Windows\\System32\\drivers\\etc<\/strong>:<\/p>\n<p><a href=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/11.jpg\"><img loading=\"lazy\" class=\"size-medium wp-image-110 aligncenter\" src=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/11-300x62.jpg\" alt=\"1\" width=\"300\" height=\"62\" srcset=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/11-300x62.jpg 300w, https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/11.jpg 1015w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Double click on file <strong>hosts<\/strong> and when it ask<strong> Open with<\/strong> choose <strong>Notepad<\/strong> (or any preferred text editor) and click ok (<strong>Note: If it says &#8220;Access denied&#8221; right click on file and click on &#8220;Run as Administrator&#8221;!<\/strong>). When you open it, scroll it to the end. On new line you\u2019ll type <strong>IP<\/strong> (which you got from us) and <strong>name of your domain<\/strong> twice (once with <strong>www<\/strong> and once without it) like this:<\/p>\n<p><a href=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/21.jpg\"><img loading=\"lazy\" class=\"size-medium wp-image-114 aligncenter\" src=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/21-300x42.jpg\" alt=\"2\" width=\"300\" height=\"42\" srcset=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/21-300x42.jpg 300w, https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/21.jpg 721w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Save changed file (<strong>ctrl + s<\/strong>). If you can\u2019t save it maybe your Antivirus program doesn\u2019t allow you to change that file for security reasons. Disable it and try again. Now you should be able to see your site even though it hasn\u2019t propagated yet.<br \/>\nYou can always check status of propagation at <a title=\"WhatsMyDNS\" href=\"https:\/\/www.whatsmydns.net\/\" target=\"_blank\">https:\/\/www.whatsmydns.net\/<\/a>. Just enter name of you site (your-domain.com) in prompt field, leave second field to be <strong>A<\/strong> and click search. If you see IP we sent you that means it has changed.<br \/>\n<strong>Don\u2019t forget to revert changes (delete those two lines you entered in hosts file) when site is propagated!<\/strong><\/p>\n<h2>Linux<\/h2>\n<p>Enter your terminal and type <strong># sudo nano \/etc\/hosts<\/strong> (instead of <strong>nano<\/strong> you can use preferred text editor) and enter your root password:<\/p>\n<p><a href=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/3.jpg\"><img loading=\"lazy\" class=\"size-medium wp-image-115 aligncenter\" src=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/3-300x39.jpg\" alt=\"3\" width=\"300\" height=\"39\" srcset=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/3-300x39.jpg 300w, https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/3.jpg 662w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Then enter two lines with your new <strong>IP<\/strong>, <strong>www.your-domain.com<\/strong> and <strong>your-domain.com<\/strong> in it:<\/p>\n<p><a href=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/4.jpg\"><img loading=\"lazy\" class=\"size-medium wp-image-120 aligncenter\" src=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/4-300x206.jpg\" alt=\"4\" width=\"300\" height=\"206\" srcset=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/4-300x206.jpg 300w, https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/4.jpg 663w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>After that, if you are in <strong>Nano<\/strong>, press <strong>Ctrl + X<\/strong>, then <strong>Y<\/strong> and <strong>Enter<\/strong>.<br \/>\nYou can always check status of propagation at <a title=\"WhatsMyDNS\" href=\"https:\/\/www.whatsmydns.net\/\" target=\"_blank\">https:\/\/www.whatsmydns.net\/<\/a>. Just enter name of you site (your-domain.com) in prompt field, leave second field to be <strong>A<\/strong> and click search. If you see IP we sent you that means it has changed.<br \/>\n<strong>Don\u2019t forget to revert changes (delete those two lines you entered in hosts file) when site is propagated!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you get our mail with login details you still cannot see your site. This is because you need to change Nameservers. Even when you change them you need to wait as long as 24-48 hours for propagation. If you want to see you site before that and especially if you want to check if&#8230; <a class=\"read-more\" href=\"https:\/\/servikus.com\/tutorials\/changing-etchosts-file\/\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[],"_links":{"self":[{"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/posts\/106"}],"collection":[{"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/comments?post=106"}],"version-history":[{"count":13,"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/posts\/106\/revisions"}],"predecessor-version":[{"id":371,"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/posts\/106\/revisions\/371"}],"wp:attachment":[{"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/media?parent=106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/categories?post=106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/tags?post=106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}