{"id":12264,"date":"2024-09-05T14:44:18","date_gmt":"2024-09-05T14:44:18","guid":{"rendered":"https:\/\/greenwebpage.com\/community\/?p=12264"},"modified":"2024-10-01T07:58:09","modified_gmt":"2024-10-01T07:58:09","slug":"how-to-view-hosts-file-in-linux","status":"publish","type":"post","link":"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/","title":{"rendered":"How to View Hosts File in Linux"},"content":{"rendered":"\n<p><a id=\"post-12264-_heading=h.1fob9te\"><\/a><br>  In Linux, the host file is a text file that contains important details such as website names and IP addresses. It allows your machine to find websites without relying on a DNS server. Viewing and inspecting the host file is essential for troubleshooting and addressing network problems.<br><a id=\"post-12264-_heading=h.3znysh7\"><\/a><\/p>\n\n\n\n<p>Furthermore, It also helps you allow or block specific websites on your system. Thus, you can efficiently manage and configure your network through the Hosts file.<br><a id=\"post-12264-_heading=h.tyjcwt\"><\/a><\/p>\n\n\n\n<p><a id=\"post-12264-_heading=h.3dy6vkm\"><\/a>\n  This post aims to explore how to view the Hosts file in a <a href=\"https:\/\/www.kernel.org\/\">Linux-based system<\/a>.\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a id=\"post-12264-_heading=h.1t3h5sf\"><\/a><strong>How to View Hosts File in Linux (Ubuntu 24.04)?<\/strong><\/h2>\n\n\n\n<p>Use these methods to view Hosts files in Linux-based systems: <\/p>\n\n\n\n<p><a href=\"#Method-1:-View-Hosts-File-via-\u201ccat\u201d-in-Ubuntu-24.04\">Method 1: View Hosts File via \u201ccat\u201d in Ubuntu 24.04<\/a><\/p>\n\n\n\n<p><a href=\"#Method-2:-View-Hosts-File-with-\u201cNano\u201d-in-Ubuntu-24.04\">Method 2: View Hosts File with \u201cNano\u201d in Ubuntu 24.04<\/a><\/p>\n\n\n\n<p><a href=\"#Method-3:-View-Hosts-File-using-\u201cvim\u201d-in-Ubuntu-24.04\">Method 3: View Hosts File using \u201cvim\u201d in Ubuntu 24.04<\/a><\/p>\n\n\n\n<p><a href=\"#Method-4:-View-Hosts-File-through-\u201cFile-Manager\u201d-in-Ubuntu-24.04\">Method 4: View Hosts File through \u201cFile Manager\u201d in Ubuntu 24.04<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Method-1:-View-Hosts-File-via-\u201ccat\u201d-in-Ubuntu-24.04\"><a id=\"post-12264-_heading=h.4d34og8\"><\/a><strong>Method 1: View Hosts File via \u201ccat\u201d in Ubuntu 24.04<\/strong><\/h2>\n\n\n\n<p>\n  The \u201ccat\u201d command is the simplest method to inspect the Hosts file using the Linux terminal:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><p>  cat \/etc\/hosts<br><\/p><\/pre>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69eb9a3d1b414&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69eb9a3d1b414\" class=\"wp-block-image wp-lightbox-container\"><img fetchpriority=\"high\" decoding=\"async\" width=\"860\" height=\"257\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-1.png\" alt=\"  cat \/etc\/hosts\n\" class=\"wp-image-12265\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-1.png 860w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-1-300x90.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-1-768x230.png 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>\n  The \u201ccat\u201d command will display all the content in the host file on your terminal screen. \n<\/p>\n\n\n\n<p>\n  Alternatively, run the below command to print the content in the host file with the line number:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><p>  nl \/etc\/hosts<br><\/p><\/pre>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69eb9a3d1b72f&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69eb9a3d1b72f\" class=\"wp-block-image wp-lightbox-container\"><img decoding=\"async\" width=\"882\" height=\"254\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-2.png\" alt=\"  nl \/etc\/hosts\n\" class=\"wp-image-12266\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-2.png 882w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-2-300x86.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-2-768x221.png 768w\" sizes=\"(max-width: 882px) 100vw, 882px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>\n  You can easily find the specific details in the host file by their line numbers.\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Method-2:-View-Hosts-File-with-\u201cNano\u201d-in-Ubuntu-24.04\"><a id=\"post-12264-_heading=h.2s8eyo1\"><\/a><strong>Method 2: View Hosts File with \u201cNano\u201d in Ubuntu 24.04<\/strong><\/h2>\n\n\n\n<p>\n  In Linux-based operating systems like Ubuntu 24.04, Nano is a simple and commonly used text editor that allows you to view and edit files. To open the Hosts file using Nano, run the command:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><p>  sudo nano \/etc\/hosts<br><\/p><\/pre>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69eb9a3d1b9fe&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69eb9a3d1b9fe\" class=\"wp-block-image wp-lightbox-container\"><img decoding=\"async\" width=\"861\" height=\"53\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-3.png\" alt=\"  sudo nano \/etc\/hosts\n\" class=\"wp-image-12267\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-3.png 861w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-3-300x18.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-3-768x47.png 768w\" sizes=\"(max-width: 861px) 100vw, 861px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>When you open the Hosts file using the Nano editor, it will display all the existing content. The example is attached below: <\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69eb9a3d1bc55&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69eb9a3d1bc55\" class=\"wp-block-image wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"891\" height=\"579\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-4.png\" alt=\"Opening hosts file in Nano editor\" class=\"wp-image-12268\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-4.png 891w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-4-300x195.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-4-768x499.png 768w\" sizes=\"(max-width: 891px) 100vw, 891px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>\n  It is a user-friendly text editor that can be used to view and manipulate your host files in Linux systems.\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Method-3:-View-Hosts-File-using-\u201cvim\u201d-in-Ubuntu-24.04\"><a id=\"post-12264-_heading=h.17dp8vu\"><\/a><strong>Method 3: View Hosts File using \u201cvim\u201d in Ubuntu 24.04<\/strong><\/h2>\n\n\n\n<p>\n  The \u201cvim\u201d text editor is powerful and advanced in a Linux-based system. If you want to view your system Hosts file using \u201cvim\u201d, ensure that it is installed on your system:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><p>  sudo apt install vim -y<br><\/p><\/pre>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69eb9a3d1bf3e&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69eb9a3d1bf3e\" class=\"wp-block-image wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"890\" height=\"507\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-5.png\" alt=\"  sudo apt install vim -y\n\" class=\"wp-image-12269\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-5.png 890w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-5-300x171.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-5-768x438.png 768w\" sizes=\"(max-width: 890px) 100vw, 890px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69eb9a3d1c146&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69eb9a3d1c146\" class=\"wp-block-image wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"892\" height=\"487\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-6.png\" alt=\"  sudo apt install vim -y\n\" class=\"wp-image-12270\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-6.png 892w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-6-300x164.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-6-768x419.png 768w\" sizes=\"(max-width: 892px) 100vw, 892px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>\n  Once you have confirmed the \u201cvim\u201d installation on your system. You can view the Hosts file by executing the below command:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><p>  sudo vim \/etc\/hosts<br><\/p><\/pre>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69eb9a3d1c3c9&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69eb9a3d1c3c9\" class=\"wp-block-image wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"873\" height=\"51\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-7.png\" alt=\"  sudo vim \/etc\/hosts\n\" class=\"wp-image-12271\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-7.png 873w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-7-300x18.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-7-768x45.png 768w\" sizes=\"(max-width: 873px) 100vw, 873px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69eb9a3d1c5d6&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69eb9a3d1c5d6\" class=\"wp-block-image wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"888\" height=\"578\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-8.png\" alt=\"Viewing hosts file\" class=\"wp-image-12272\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-8.png 888w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-8-300x195.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-8-768x500.png 768w\" sizes=\"(max-width: 888px) 100vw, 888px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>\n  Like other text editors, \u201cvim\u201d can be utilized for viewing and editing Hosts files in your Ubuntu 24.04 or other Linux systems. \n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Method-4:-View-Hosts-File-through-\u201cFile-Manager\u201d-in-Ubuntu-24.04\"><a id=\"post-12264-_heading=h.3rdcrjn\"><\/a><strong>Method 4: View Hosts File through \u201cFile Manager\u201d in Ubuntu 24.04<\/strong><\/h2>\n\n\n\n<p>\n  If you prefer to use a graphical tool, such as \u201cFile Manager\u201d to view your Ubuntu 24.04 Hosts file, here are a few steps:\n<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open your system \u201cFiles\u201d.<\/li>\n\n\n\n<li>Navigate the \u201cother locations\u201d.<\/li>\n\n\n\n<li> Select your system \u201cDrive\u201d. <br>  <\/li>\n<\/ul>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69eb9a3d1c8e5&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69eb9a3d1c8e5\" class=\"wp-block-image wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"973\" height=\"619\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-9.png\" alt=\"Select system drive\" class=\"wp-image-12273\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-9.png 973w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-9-300x191.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-9-768x489.png 768w\" sizes=\"(max-width: 973px) 100vw, 973px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>\n  In your system drive (i.e. ubuntu), navigate to the \u201c\/etc\/\u201d directory:\n<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69eb9a3d1cb31&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69eb9a3d1cb31\" class=\"wp-block-image wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"888\" height=\"545\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-10.png\" alt=\"Navigate to etc directory\" class=\"wp-image-12274\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-10.png 888w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-10-300x184.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-10-768x471.png 768w\" sizes=\"(max-width: 888px) 100vw, 888px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>\n  Locate the Hosts file in the \u201c\/etc\/\u201d directory, as shown below:\n<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69eb9a3d1cd75&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69eb9a3d1cd75\" class=\"wp-block-image wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"884\" height=\"540\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-11.png\" alt=\"Locate the hosts file in etc directory\" class=\"wp-image-12275\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-11.png 884w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-11-300x183.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-11-768x469.png 768w\" sizes=\"(max-width: 884px) 100vw, 884px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>\n  Double-click on the \u201cHosts\u201d file or right-click to choose  \u201cOpen with text editor\u201d to view the Hosts file:\n<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69eb9a3d1cfc5&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69eb9a3d1cfc5\" class=\"wp-block-image wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"811\" height=\"528\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-12.png\" alt=\"Open hosts file in an editor \" class=\"wp-image-12276\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-12.png 811w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-12-300x195.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/word-image-12264-12-768x500.png 768w\" sizes=\"(max-width: 811px) 100vw, 811px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>The above are the most commonly used methods to view and edit Hosts file in Linux-based systems, including Ubuntu 24.04. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"post-12264-_heading=h.lnxbz9\"><\/a><strong>Conclusion<\/strong><\/h4>\n\n\n\n<p>In Linux systems like Ubuntu 24.04, you can view your system Hosts file using various methods. You can use a Linux terminal or File Manager to view the existing content of Hosts file. The \u201ccat\u201d, \u201cnano\u201d, and \u201cvim\u201d are the terminal-based commands. If you do not want to use the terminal, you can use the \u201cFile Manager\u201d. <\/p>\n\n    <div class=\"xs_social_share_widget xs_share_url after_content \t\tmain_content  wslu-style-1 wslu-share-box-shaped wslu-fill-colored wslu-none wslu-share-horizontal wslu-theme-font-no wslu-main_content\">\n\n\t\t\n        <ul>\n\t\t\t        <\/ul>\n    <\/div> \n","protected":false},"excerpt":{"rendered":"<p>In Linux, the host file is a text file that contains important details such as website names and IP addresses. It allows your machine to find websites without relying on a DNS server. Viewing and inspecting the host file is essential for troubleshooting and addressing network problems. Furthermore, It also helps you allow or block [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":12281,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[365,230],"class_list":["post-12264","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-hosts-file","tag-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to View Hosts File in Linux - Greenwebpage Community<\/title>\n<meta name=\"description\" content=\"In this article, we try to explore the way to view hosts file in Linux system (Ubuntu 24.04 Long Term Support).\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to View Hosts File in Linux - Greenwebpage Community\" \/>\n<meta property=\"og:description\" content=\"In this article, we try to explore the way to view hosts file in Linux system (Ubuntu 24.04 Long Term Support).\" \/>\n<meta property=\"og:url\" content=\"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"Greenwebpage Community\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-05T14:44:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-01T07:58:09+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/View-hosts-file-in-Linux.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Karim Buzdar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Karim Buzdar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/\"},\"author\":{\"name\":\"Karim Buzdar\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8\"},\"headline\":\"How to View Hosts File in Linux\",\"datePublished\":\"2024-09-05T14:44:18+00:00\",\"dateModified\":\"2024-10-01T07:58:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/\"},\"wordCount\":543,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/View-hosts-file-in-Linux.jpeg\",\"keywords\":[\"Hosts file\",\"Linux\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/\",\"url\":\"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/\",\"name\":\"How to View Hosts File in Linux - Greenwebpage Community\",\"isPartOf\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/View-hosts-file-in-Linux.jpeg\",\"datePublished\":\"2024-09-05T14:44:18+00:00\",\"dateModified\":\"2024-10-01T07:58:09+00:00\",\"description\":\"In this article, we try to explore the way to view hosts file in Linux system (Ubuntu 24.04 Long Term Support).\",\"breadcrumb\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/#primaryimage\",\"url\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/View-hosts-file-in-Linux.jpeg\",\"contentUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/View-hosts-file-in-Linux.jpeg\",\"width\":1020,\"height\":600,\"caption\":\"View hosts file in Linux\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/greenwebpage.com\/community\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to View Hosts File in Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#website\",\"url\":\"https:\/\/greenwebpage.com\/community\/\",\"name\":\"Greenwebpage Community\",\"description\":\"Get online in three steps with our wide range of web hosting solutions. Choose from professional business to enterprise options designed to meet your needs.\",\"publisher\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/greenwebpage.com\/community\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\",\"name\":\"Greenwebpage Community\",\"url\":\"https:\/\/greenwebpage.com\/community\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png\",\"contentUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png\",\"width\":512,\"height\":512,\"caption\":\"Greenwebpage Community\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8\",\"name\":\"Karim Buzdar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g\",\"caption\":\"Karim Buzdar\"},\"sameAs\":[\"https:\/\/greenwebpage.com\"],\"url\":\"https:\/\/greenwebpage.com\/community\/author\/karim\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to View Hosts File in Linux - Greenwebpage Community","description":"In this article, we try to explore the way to view hosts file in Linux system (Ubuntu 24.04 Long Term Support).","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:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to View Hosts File in Linux - Greenwebpage Community","og_description":"In this article, we try to explore the way to view hosts file in Linux system (Ubuntu 24.04 Long Term Support).","og_url":"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/","og_site_name":"Greenwebpage Community","article_published_time":"2024-09-05T14:44:18+00:00","article_modified_time":"2024-10-01T07:58:09+00:00","og_image":[{"width":1020,"height":600,"url":"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/View-hosts-file-in-Linux.jpeg","type":"image\/jpeg"}],"author":"Karim Buzdar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Karim Buzdar","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/#article","isPartOf":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/"},"author":{"name":"Karim Buzdar","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8"},"headline":"How to View Hosts File in Linux","datePublished":"2024-09-05T14:44:18+00:00","dateModified":"2024-10-01T07:58:09+00:00","mainEntityOfPage":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/"},"wordCount":543,"commentCount":0,"publisher":{"@id":"https:\/\/greenwebpage.com\/community\/#organization"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/View-hosts-file-in-Linux.jpeg","keywords":["Hosts file","Linux"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/","url":"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/","name":"How to View Hosts File in Linux - Greenwebpage Community","isPartOf":{"@id":"https:\/\/greenwebpage.com\/community\/#website"},"primaryImageOfPage":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/View-hosts-file-in-Linux.jpeg","datePublished":"2024-09-05T14:44:18+00:00","dateModified":"2024-10-01T07:58:09+00:00","description":"In this article, we try to explore the way to view hosts file in Linux system (Ubuntu 24.04 Long Term Support).","breadcrumb":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/#primaryimage","url":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/View-hosts-file-in-Linux.jpeg","contentUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/09\/View-hosts-file-in-Linux.jpeg","width":1020,"height":600,"caption":"View hosts file in Linux"},{"@type":"BreadcrumbList","@id":"https:\/\/greenwebpage.com\/community\/how-to-view-hosts-file-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/greenwebpage.com\/community\/"},{"@type":"ListItem","position":2,"name":"How to View Hosts File in Linux"}]},{"@type":"WebSite","@id":"https:\/\/greenwebpage.com\/community\/#website","url":"https:\/\/greenwebpage.com\/community\/","name":"Greenwebpage Community","description":"Get online in three steps with our wide range of web hosting solutions. Choose from professional business to enterprise options designed to meet your needs.","publisher":{"@id":"https:\/\/greenwebpage.com\/community\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/greenwebpage.com\/community\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/greenwebpage.com\/community\/#organization","name":"Greenwebpage Community","url":"https:\/\/greenwebpage.com\/community\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/","url":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png","contentUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png","width":512,"height":512,"caption":"Greenwebpage Community"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8","name":"Karim Buzdar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g","caption":"Karim Buzdar"},"sameAs":["https:\/\/greenwebpage.com"],"url":"https:\/\/greenwebpage.com\/community\/author\/karim\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/12264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/comments?post=12264"}],"version-history":[{"count":6,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/12264\/revisions"}],"predecessor-version":[{"id":12501,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/12264\/revisions\/12501"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/media\/12281"}],"wp:attachment":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/media?parent=12264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/categories?post=12264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/tags?post=12264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}