{"id":999959154,"date":"2022-03-23T13:27:00","date_gmt":"2022-03-23T13:27:00","guid":{"rendered":"https:\/\/f60host.com\/support\/?p=999959154"},"modified":"2022-03-23T13:27:00","modified_gmt":"2022-03-23T13:27:00","slug":"how-to-edit-hosts-file-a-beginners-guide","status":"publish","type":"post","link":"https:\/\/f60host.com\/support\/how-to-edit-hosts-file-a-beginners-guide\/","title":{"rendered":"How to Edit Hosts File: A Beginner\u2019s Guide"},"content":{"rendered":"\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/f60host.com\/support\/wp-content\/uploads\/2022\/03\/how-to-edit-hosts-file-by-f60-host-1.jpg\"><img decoding=\"async\" src=\"https:\/\/f60host.com\/support\/wp-content\/uploads\/2022\/03\/how-to-edit-hosts-file-by-f60-host-1.jpg\" alt=\"How to Edit Hosts File: A Beginner\u2019s Guide\" class=\"wp-image-999960402\" title=\"How to Edit Hosts File\"\/><\/a><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"a-beginner-s-guide-for-edit-hosts-file\">A Beginner\u2019s Guide for Edit Hosts File:<\/h2>\n\n\n\n<p>The <strong>DNS<\/strong> (Domain Name System) is the internet&#8217;s phone book, as we all know. However, did you realize that your computer&#8217;s hosts file can also be utilized as a domain name directory? This post will explain what the hosts file is and how to update it to simulate a DNS change in Windows 10, Linux, and Mac.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-a-hosts-file\">What is a Hosts File?<\/h2>\n\n\n\n<p>In a nutshell, a <strong>hosts file <\/strong>is a local file that contains domain names and the <strong>IP addresses<\/strong> that correspond to them. It&#8217;s included in all major operating systems and serves as a map for identifying and locating IP network hosts.<\/p>\n\n\n\n<p>Your computer will check the host&#8217;s file every time you visit a website to see which IP address it connects to. If the information is missing, your internet service provider will hunt up the resources needed to load the site in the DNS.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-s-the-point-of-changing-the-hosts-file\">What&#8217;s the Point of Changing the Hosts File?<\/h2>\n\n\n\n<p>When you&#8217;ve recently purchased a domain, you can take advantage of the circumstances described above. Alternatively, if you&#8217;re moving your website to a new hosting provider and need your domain to point to the new server. It usually takes 24 to 48 hours for your domain to start working, and you won&#8217;t be able to view your site during that period.<\/p>\n\n\n\n<p>You can access your website by modifying the hosts file and adding a <strong>custom IP address <\/strong>that links to your domain. This is useful if you want to modify your site after migrating and see how it\u2019ll look on the new server.<\/p>\n\n\n\n<p>The hosts file is formatted in plain text. As a result, you can change it using any text editor, such as Notepad.<\/p>\n\n\n\n<p>Keep in mind, however, that the modifications will only affect the system where the hosts file is located.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"edit-the-hosts-file-in-windows-10\">Edit the Hosts File in Windows 10:<\/h2>\n\n\n\n<p><strong>You&#8217;ll need an IP address for your domain before we start:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Log into your <strong>cPanel account<\/strong>, then check for details about your <strong>hosting plan<\/strong>, <strong>server<\/strong>, and <strong>IP address<\/strong> in the left sidebar.<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>Copy the <strong>IP address <\/strong>of the server:<\/li><\/ol>\n\n\n\n<p>Let&#8217;s go over to the hosts file and make some changes. For Windows 10, there are two options: manually or via the Hosts File Editor tool. In general, the instructions below can be used with any version of Windows.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"manually-alter-the-file\">Manually alter the file:<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Select Notepad from the Start menu. <strong>Run as administrator<\/strong> by right-clicking.<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/f60host.com\/support\/wp-content\/uploads\/2022\/02\/windows-notepad-001.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/f60host.com\/support\/wp-content\/uploads\/2022\/02\/windows-notepad-001.png\" alt=\"How to Edit Hosts File: A Beginner\u2019s Guide\" class=\"wp-image-999959158\" width=\"768\" height=\"290\"\/><\/a><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>Go to File -&gt; Open once you&#8217;re in Notepad. To find the hosts file, navigate to <strong>C:WindowsSystem32Driversetc <\/strong>and choose All Files.<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/f60host.com\/support\/wp-content\/uploads\/2022\/02\/open-hosts-file-02.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/f60host.com\/support\/wp-content\/uploads\/2022\/02\/open-hosts-file-02-1024x572.png\" alt=\" Hosts File\" class=\"wp-image-999959159\" width=\"768\" height=\"429\"\/><\/a><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>The hosts file can now be edited. After a space, type your domain name, followed by the <strong>custom IP address<\/strong> you created previously.<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/f60host.com\/support\/wp-content\/uploads\/2022\/02\/add-ip-address-on-hosts-03.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/f60host.com\/support\/wp-content\/uploads\/2022\/02\/add-ip-address-on-hosts-03.png\" alt=\" Hosts File\" class=\"wp-image-999959160\" width=\"555\" height=\"399\"\/><\/a><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li>Don&#8217;t forget to save your modifications when you&#8217;re finished.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"using-hosts-file-editor-tool\">Using Hosts File Editor Tool:<\/h2>\n\n\n\n<p><strong>Using the Hosts File Editor is a more convenient approach to edit the hosts file in Windows 10.<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Once you&#8217;re in the Hosts File Editor, fill in the fields for your target <strong>IP address<\/strong> and <strong>domain name<\/strong>.<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/f60host.com\/support\/wp-content\/uploads\/2022\/02\/host-file-editor-4.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/f60host.com\/support\/wp-content\/uploads\/2022\/02\/host-file-editor-4.png\" alt=\" Hosts File\" class=\"wp-image-999959161\" width=\"609\" height=\"240\"\/><\/a><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>Make a backup of your modifications.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"in-linux-edit-the-hosts-file\">In Linux, edit the hosts file:<\/h2>\n\n\n\n<p>On Linux, you can complete the job with your favorite text editor. In this case, we&#8217;ll utilize Gedit in <strong>Ubuntu<\/strong>. By using <strong>Ctrl+Alt+T<\/strong>, you can access the Terminal.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Type the following command, then enter your admin password:<\/li><\/ol>\n\n\n\n<p><strong>sudo su<\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/f60host.com\/support\/wp-content\/uploads\/2022\/02\/ubuntu-terminal-51.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/f60host.com\/support\/wp-content\/uploads\/2022\/02\/ubuntu-terminal-51.png\" alt=\"Ubuntu\" class=\"wp-image-999959162\" width=\"548\" height=\"126\"\/><\/a><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>Type the following command into Gedit and press Enter to access the hosts file:<\/li><\/ol>\n\n\n\n<p><strong>sudo gedit \/etc\/hosts<\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/f60host.com\/support\/wp-content\/uploads\/2022\/02\/ubuntu-gedit-hosts-6.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/f60host.com\/support\/wp-content\/uploads\/2022\/02\/ubuntu-gedit-hosts-6.png\" alt=\"Ubuntu\" class=\"wp-image-999959163\" width=\"542\" height=\"128\"\/><\/a><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>At the bottom of the hosts file, add the targeted IP address, a space, and then the domain name, just like in the Windows 10 instruction.<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li>Make a backup of your modifications.<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"in-macos-open-the-hosts-file-and-make-changes\">In MacOS, open the Hosts File and make changes:<\/h3>\n\n\n\n<p>Follow these instructions to modify the hosts file if you&#8217;re running macOS from Leopard (10.6) to the most recent version:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Open Terminal by clicking on the <strong>Launchpad<\/strong>.<\/li><\/ol>\n\n\n\n<p>The Nano editor will be used. Insert the following command to <strong>run it as an administrator:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>Enter the following statement:<\/li><\/ol>\n\n\n\n<p><strong>sudo nano \/private\/etc\/hosts<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>Enter your password here. The hosts file will be directed to you.<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li>Add the <strong>IP address <\/strong>you want to use, followed by the domain name, separated by a space.<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"5\"><li>Make careful to use the <strong>Ctrl + O<\/strong> shortcut to save your changes<\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>A Beginner\u2019s Guide for Edit Hosts File: The DNS (Domain Name System) is the internet&#8217;s<span class=\"excerpt-hellip\"> [\u2026]<\/span><\/p>\n","protected":false},"author":1,"featured_media":999960402,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-999959154","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-panel-hosting"],"_links":{"self":[{"href":"https:\/\/f60host.com\/support\/wp-json\/wp\/v2\/posts\/999959154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/f60host.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/f60host.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/f60host.com\/support\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/f60host.com\/support\/wp-json\/wp\/v2\/comments?post=999959154"}],"version-history":[{"count":0,"href":"https:\/\/f60host.com\/support\/wp-json\/wp\/v2\/posts\/999959154\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/f60host.com\/support\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/f60host.com\/support\/wp-json\/wp\/v2\/media?parent=999959154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/f60host.com\/support\/wp-json\/wp\/v2\/categories?post=999959154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/f60host.com\/support\/wp-json\/wp\/v2\/tags?post=999959154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}