{"componentChunkName":"component---src-templates-tag-js","path":"/tags/computer-tricks/","result":{"data":{"site":{"siteMetadata":{"title":"LoginRadius Blog"}},"allMarkdownRemark":{"totalCount":1,"edges":[{"node":{"fields":{"slug":"/engineering/hosts-file/"},"html":"<h2 id=\"what-is-the-hosts-file\" style=\"position:relative;\"><a href=\"#what-is-the-hosts-file\" aria-label=\"what is the hosts file permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is the “hosts” file</h2>\n<p>A hosts file which is used by operating systems to map a connection between an IP address and domain names before going to domain name servers. This file is a simple text file with the mapping of IPs and domain names.</p>\n<h3 id=\"lets-talk-about-the-usage-of-the-hosts-file\" style=\"position:relative;\"><a href=\"#lets-talk-about-the-usage-of-the-hosts-file\" aria-label=\"lets talk about the usage of the hosts file permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Let’s talk about the usage of the hosts file</h3>\n<h5 id=\"protecting-privacy\" style=\"position:relative;\"><a href=\"#protecting-privacy\" aria-label=\"protecting privacy permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Protecting Privacy</h5>\n<p>You can use this to block advertisers, trackers, block marketing, or third party websites, block ads, banners, 3rd party page counters, or sites to protect your privacy. </p>\n<h5 id=\"block-website-for-your-kids\" style=\"position:relative;\"><a href=\"#block-website-for-your-kids\" aria-label=\"block website for your kids permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Block website for your kids</h5>\n<p>If you don’t want your children to open some websites you can block them by the hosts file. You can decide entirely what you wish to block and even most hijackers and possibly unwanted programs. </p>\n<h5 id=\"security\" style=\"position:relative;\"><a href=\"#security\" aria-label=\"security permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Security</h5>\n<p>We can utilize it as a firewall in our local system. The hosts file is to block Spyware and/or ad Networks you can add all the Spyware sites &#x26; ad Networks domain names in your hosts file also you can block dangerous sites, ransomware sites, blockchain sites. </p>\n<h5 id=\"development\" style=\"position:relative;\"><a href=\"#development\" aria-label=\"development permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Development</h5>\n<p>You know during the development, you need to run your web application on the localhost for verification. Websites can run on the localhost, 127.0.0.1, or localhost IP address. There are some limitations in the localhost, you want to review your website on the custom domain before launching on the public domain suppose you have developed the e-commerce. You want to debug some payment gateway issue but your payment gateway is not supporting localhost URL or IP in the case of successful payment. You can add custom domain in the hosts file and validate the payment process on localhost </p>\n<h4 id=\"how-to-edit-hosts-file\" style=\"position:relative;\"><a href=\"#how-to-edit-hosts-file\" aria-label=\"how to edit hosts file permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How to edit hosts file</h4>\n<h5 id=\"windows-8-or-10\" style=\"position:relative;\"><a href=\"#windows-8-or-10\" aria-label=\"windows 8 or 10 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Windows 8 or 10</h5>\n<p>Windows operating system we need to open the host file </p>\n<ol>\n<li>Go to the Start menu and start typing the Notepad.</li>\n<li>Right-click Notepad and choose Run as administrator</li>\n</ol>\n<p>  <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 386px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 179.01554404145077%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAkCAYAAACJ8xqgAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEgElEQVRIx61W609bdRg+f4JA4hYvmcwx7NgYW7Fc2tJSLygxSjJlRLcYoxvop30xccZPS/zo3PyqH/1iZowfTAiR24Sy2Xt7egFaejttKdDSK1DE8fh7f+yUbiKNWZs8+b3n/b3nOc/7vKfnHKH+2g946spN1I18h/rh2yz+Fg2f3kbd8C2ep2OCvFfHcg1X2d7H3zDcRP0nrP7KLbbuQWhW6aDTanC+XYVWZQd6DK+h+UwblJ1qqHUGdOt60anV4yTLUdyh0fFYrX8FKha3vtyJJnbc3HqOQ3i2qx9NhkE83/0WXmzXQtFtwNFTShxr68LJDh2aVD08Tzlajys1OMLiEyzfyOJnTqtwRKHkOVqFH38bx09jc7gzNos7v/yKsYkp3J2dw9SMEZN/zHJMMfBcRSznp1l81ziH2fsmzJnMEKyLIcQCPoQCiwj4/ShtbeHvnR1sbW4+ho1DY/knGG1u+PwBOEQ3jEYjJiYmMD09DbfbDa/Xx+A9BHv78/PzKBSKeLC7C2HGasf3MyYY/7yHSUY2OjqK8fFx+Hw+LCws8GICxZWgfRl0vPlQpTBjEzG/uMivZDabeUEoxGyIxcqIx+OQJAnRaJSDYsodSHjftwS/z8OKYlhdXcXy8jJWVlaQSCQQDocRiUQ4gZ/5GwgEOEgx1RKoltYt5j0ntPgTEO0OpNfXsb29za9ULBa5SlkZERPkOJPJIJfLIZvNIp/P87hUKu0RBkNWrGRiEF0ibDYrnE4nP0lWSjGRU6u0Li0tYW1tjZMQMdWtMzFlwvmwCyvpGIJLIT5Z8oTaTSaTXBG1TKCWU6kU74I6IDIC5R4htIiLcDtFiKLIzaWVCKgdKiaVsqekhpQVCgW+X9l62UNnMIq4FGF+JfhESRWZTP4RMQ2B1Hk8HjgczOt0+hGFpI5WUrhL96HLH0UiLmGB3Tomk4l7RGTBYJATysMg8wkyCYGUkfJ0eh1/bZdQ2mGEoXgYhXyhXCRfsfJYzhGI5HFkMtmKobB2iw+vfFDx/kmZf6Fyr+yhGEliI5/D+gEn/NfJlasc0/RJpeCMpRhhlhMeprCaeiIklUIklmBm56q2XI2QT5laDkgJNpTaEPLHlyeaKHv4pIR8KC5prSYe7t828RiKuXztCKVkGPlcviYeckKPFOU3ds0UitJqjYcST9V2KB4pWVuFXinAPCxU/S9Xwz5hJFYeymGPqGrYfwUEY8imU1hd23s3VD72/w9IyMbGBvMwkcaD0hZy7CrLiThbM3iSn/DzpBFWu519Qd3D6O8T/KvKxr5zLE4X7CJ7j7CXlpPB5vJgzuxgex5YbDaYzBY43V5YrA5W64Gd7dudXghN6leh7HsHjR16aAeGcMbQj5e0r6P77UG8cL4TTxsuo0F3GWc1Xbj+1RBa1BqcGrwG1fANHD3XgeEPL0Kj0+K5vl40jvTvEbbo38Qx9iXb/sYAFD19aGaEyr4BnOjS4/T716EY+gKtegMujnwAhVoHxaXP0fbZ1ziu68d7N75E74ULaHn3Es5e/Qj/ANDnuTDoxgo/AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Start Menu\"\n        title=\"Start Menu\"\n        src=\"/static/c1e0fe215fc1a5012e2137091af255db/7bc0b/windows1.png\"\n        srcset=\"/static/c1e0fe215fc1a5012e2137091af255db/7bc0b/windows1.png 386w\"\n        sizes=\"(max-width: 386px) 100vw, 386px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<ol start=\"3\">\n<li>\n<p>Open the hosts file. Click on File > Open and Copy and Paste the following path`</p>\n<p><code>c:\\Windows\\System32\\Drivers\\etc\\hosts</code></p>\n</li>\n</ol>\n<p>  <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 63.230769230769226%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAYAAACpUE5eAAAACXBIWXMAAAsTAAALEwEAmpwYAAACLElEQVQ4y32T6Y7aMBSFef9H6K9K/dHXqFRV3abSwMBAgAEStuyLnTh2Fk7vNVBmUFukIyfY+XzO9fUgznIUhUBVVajr2kpVJWqtz6pvo6ZRqRpSlhBCwhhD7wp1KWleQukKg7Zp7ERZltj7AQTBjWGAsouvYti9LIwM8Pf8HkURBrj8tHVRo+16GJ1DigSFEOTkrP50Qt/3aNsW+gIoL6k6+qY2DfwgfAtMsgJRSrBSIYhSiJJ2bxjQXKIzyNjnsiLnNFY0FhTfiwTm6+0N2FLMfa6xO0boGoOO3JTCJ6e5nT+RQ5ZdSy6zvEBO6rrO1lVTiXbbV8CGgCE5WvoxFNWz7QCVO4jD3V+BSZLYmnFkKSWyLKPIwVuHodQYLrcIj0cIqVCmDtL4+E9gHMW2VAwsigK+79+ARtcQigobZRSzQEr1lImD5D9AdngF5nl+BySHQmkCJjhR/YSsIGIHWRr8AfY9Q6k81GppmiKOzw655bgT7oAGq42L7z9+YjGfY38IoMUSRXqAodPEqbsuJWhvI2Z0KRpyy5dC0km/AfJO3Hcche3zTTjuX/A0m2O22mG1C+DRgbnUBdxvnudis9lQgvQCz3A4HDDgZuU4vAuD2D4rDn2M1z4+/orw4ese7794ePdpTc9brI8ppos1vj0MMZo4WCwWtIGHLbcN14FdMd11Xfvna3kkx5ljMpng8XGImeNg9bLEcLrE54cxRrMVxuMxnp+nGD2N8Bu70OBAxMChEgAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"edit-hosts-file-windows\"\n        title=\"edit-hosts-file-windows\"\n        src=\"/static/a6b91910fadbb359142add8e605b588b/e5715/windows2.png\"\n        srcset=\"/static/a6b91910fadbb359142add8e605b588b/a6d36/windows2.png 650w,\n/static/a6b91910fadbb359142add8e605b588b/e5715/windows2.png 768w,\n/static/a6b91910fadbb359142add8e605b588b/ddc81/windows2.png 837w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>You can edit the hosts file</p>\n<p>Suppose you want to block facebook.com on your system and want to add a custom domain for your website. Just Copy and Paste following Lines</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">0.0.0.0         www.facebook.com</span>\n<span class=\"grvsc-line\">127.0.0.1       www.customdomain.com</span></code></pre>\n<p>  <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 735px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 65.53846153846153%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAYAAACpUE5eAAAACXBIWXMAAAsTAAALEwEAmpwYAAABy0lEQVQ4y51Sy47TQBDMb+0diRsSJ8R38C2IE8sJ/gBpEUis+AvY+DF+e8aO37GdzabobsdRsuvlwEil7ukZ1VT19MpRHjxXQSmFsixhtEbXdRjHUbDb7fDcOhwOT7BKkxgmy1BVFYwxiOMYmuJmsxEURYGBiIdhEPAj2+0W+/1+mdAYjbbt0DQ1siyn2JDSStRyzg9xnYk557MsM0K6tFau68LzfLiOA+VN1n3fx3p9R1jT3iV4CMIALuVry6L7Ht0JRO1j6yvHselyiCiOxHpG0NogSRKxH0URcqpFxzxNUyQEjtzrmfCkMCSyguzNPWrPPoT3fd+fItvkOud8bya6IGT5SZKKIuVN1liZqCOw/SAIkOc5Kdeyn/vLH/OEkC3Wx+b/zzonE8LJSicvx6SSX+VxmVXNKuq6lr6xcq6fk10orKqaeljJ7BkeD8qLopQxyTcFmrZFVTdik4la2s/D/lidEA5tibGrkaeRRNwP0JGPUNnouwZ4GHHY9afPWVJ1QXj13sKLjz7efA7w8jrA1QeFV9cOXn+y8fZLiHdfNVRxv9i3RYXf/rT4Tri1Ovy4a3Hzu8FPym/tLX7ZU83KpgF+OA7vvxT+BWRo33w9ocBUAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Save-hosts-file-windows\"\n        title=\"Save-hosts-file-windows\"\n        src=\"/static/fac9daf370e72e60b1fd57e8ccd07c43/7608e/windows3.png\"\n        srcset=\"/static/fac9daf370e72e60b1fd57e8ccd07c43/a6d36/windows3.png 650w,\n/static/fac9daf370e72e60b1fd57e8ccd07c43/7608e/windows3.png 735w\"\n        sizes=\"(max-width: 735px) 100vw, 735px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>After finishing the Editing, <strong>Save your hosts file</strong></p>\n<p>  <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 688px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 67.07692307692308%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAYAAACpUE5eAAAACXBIWXMAAAsTAAALEwEAmpwYAAACIklEQVQ4y21TTY/TMBDt7+HCiTsSB9hfh5A4INCKf7DaKwdAAokDC0IrdttuEydNNkntJM1H4yRNvx4z7rZqt1ga2ePYz++9mfR+2hJSxojCCEmSoqoqCo31eo3FYmFitVrhcGw2m/38OHpxmsFzHaSxxKzMkSoJx7Kg5ARZliHPc8xms5MHlsul2TsB9FWOX39HuBUBvLiEHSS4otzyIlQExIyLoqB1ZYA5mqbBdDpFXddHjHn0vo5KXP4O8NnS+CIafOrnuLgK8O02wr3vGRtUTJZEEdI0RUzriZRQSpl9Znwov1fmGcbCRkCX9awg6QoJyQ2DAMPhEIP+AJZlw/fGEEKYvf5gAGFbsClXKj4GZI8c4VBhlJGjtTavx3GCtm3QdR3m87mZWSoH+8d5XW+/HwGGYQjXcY0U3/fheR4CYieINQPz94BCkcwkSbZ7D/I5+IEjQPaGWfLhsiSGtTaH2HAzUzBrjradG3ZcqEPvjgD5FZbEDPnSrud2LbK7yGP1IHUn+RBsX2Wta3AuSdJkIpFOMyyWK1NVlpoXJfXb9gJ7zBXms5Kk/xew0dRXVYmqyFBk5AnlXO1Wl6hp5mjIhiIvUFI/ZllOirq9xBPAgR/DTRtc2yGuxQQi1riLCnz/M8SPGwcjWUGWLcndyu+6xZ7xIege8NX5GE9eu3h57uHs4z2evnHx7K2LF+8snH0QeP7ex8VNZQ6vN6f/8+P1Py8x2HduXznYAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Save-hosts-file-windows\"\n        title=\"Save-hosts-file-windows\"\n        src=\"/static/9ae12f3a031c3cf9bf210efb2cc18f9c/ebf47/windows4.png\"\n        srcset=\"/static/9ae12f3a031c3cf9bf210efb2cc18f9c/a6d36/windows4.png 650w,\n/static/9ae12f3a031c3cf9bf210efb2cc18f9c/ebf47/windows4.png 688w\"\n        sizes=\"(max-width: 688px) 100vw, 688px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Open your browser and try to access www.facebook.com and see you can’t access this site</p>\n<p>  <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 62.153846153846146%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAACXBIWXMAAAsTAAALEwEAmpwYAAAA9ElEQVQoz61TW26DMBDk/P3odSrlKOkHEkKJSYsQtmPj59TriAB5gaJaGu2yDMNod13EGEEIIcA5l+FTHt5EgX8+xejwEejQX5VS1+dXfMJTh6OAtRZlWcIY84w5CZLDNUGKw2Dgvc9u55Fw+81LwXhJwI4MdV2DMYbj4YCmaVBVVa6TeAxTizY57HuO00+L37ZLuYCUCpxLCCFzfwla6209pMjPFm1v0AmLjlv00qVagFBpVTJvw1CQCZeIYBCdSr3UUGcFMwxXzt3arDkkB9+Nx56lYcTb92+sjUsqnzuBjy8BbeciWOzr6lDmpMe15QUYzx8wY7OS8tH6GwAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Facebook-windows\"\n        title=\"Facebook-windows\"\n        src=\"/static/ca2e87ac50ce1b744a0f7f07fc98f479/e5715/windows5.png\"\n        srcset=\"/static/ca2e87ac50ce1b744a0f7f07fc98f479/a6d36/windows5.png 650w,\n/static/ca2e87ac50ce1b744a0f7f07fc98f479/e5715/windows5.png 768w,\n/static/ca2e87ac50ce1b744a0f7f07fc98f479/9f82e/windows5.png 820w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h5 id=\"linux\" style=\"position:relative;\"><a href=\"#linux\" aria-label=\"linux permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Linux</h5>\n<p>Use following instructions for Linux </p>\n<ol>\n<li>\n<p>In the Linux terminal window, open hosts file using a favorite text editor </p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">$ sudo vim /etc/hosts</span></code></pre>\n</li>\n</ol>\n<p>  <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 46.61538461538461%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAJCAYAAAAywQxIAAAACXBIWXMAAAsTAAALEwEAmpwYAAAASklEQVQoz+2MsQ3AMAgEDRQmOCamY/9FP2SAFJFS+qVr7qVrawXcHWYGGwOqB3rXchfOOTHKPX9EIDPBzBCRV1oNv0JEO7iDH7kBP6m1huAPS3YAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"linux-hosts-file\"\n        title=\"linux-hosts-file\"\n        src=\"/static/e9b2f6ff6089fd0a961fee8495beec03/e5715/linux1.png\"\n        srcset=\"/static/e9b2f6ff6089fd0a961fee8495beec03/a6d36/linux1.png 650w,\n/static/e9b2f6ff6089fd0a961fee8495beec03/e5715/linux1.png 768w,\n/static/e9b2f6ff6089fd0a961fee8495beec03/0f882/linux1.png 1584w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>  It will prompt for the password, enter your administrator password.</p>\n<ol start=\"2\">\n<li>Using the vim or your favorite text editor you can easily edit. The Linux hosts file is similar to the windows hosts file. Now again I am blocking Facebook and adding a custom domain </li>\n</ol>\n<p>  <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 41.07692307692307%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAICAYAAAD5nd/tAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAvklEQVQoz62Q1w7CMAxFOzI66QykM4Xy/794cYLECy2CioejSLZ14msvbxpERYG0rpG3LeKyRBhF4HnuYEni4GkKcTqBZ5mr+2EIz/PeORuDdhyhb1dclgVqnlFpDUX1VCkwK7CQTFYVBH1o2RXe1xU1DYx9DzNNmEkuhdge/obVCinuMAzoSTrThozzZ9P3fxd2XYeG7qgp5kjbWaGhuIrihnuxPiFEjCDwwRh7IaV076HIjMnj99oWRn8VPgABiqp9ZOXzsQAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"linux-hosts-file-edit\"\n        title=\"linux-hosts-file-edit\"\n        src=\"/static/96d45a3a2ccedff08dcd2886df06433f/e5715/linux2.png\"\n        srcset=\"/static/96d45a3a2ccedff08dcd2886df06433f/a6d36/linux2.png 650w,\n/static/96d45a3a2ccedff08dcd2886df06433f/e5715/linux2.png 768w,\n/static/96d45a3a2ccedff08dcd2886df06433f/e0577/linux2.png 1796w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<ol start=\"3\">\n<li>Save the Changes</li>\n</ol>\n<h5 id=\"mac-os\" style=\"position:relative;\"><a href=\"#mac-os\" aria-label=\"mac os permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Mac OS</h5>\n<p>Use following instructions for macOS </p>\n<ol>\n<li>Find the terminal application on your system\n-- We can use Spotlight application to search </li>\n</ol>\n<p>  <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 63.69230769230769%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAYAAACpUE5eAAAACXBIWXMAAAsTAAALEwEAmpwYAAACvElEQVQ4y0WSW2/jVBRG/RNGnZkoTdM4dZrE9vHdcZ0096SepknUkE4pDDeBhJAYUDWPvMEf4JVHbhLwMxfbZ0J5+HRs+Zzltfc+RjVaYyYbVHaDly4x7YxaO6DScKicdKg1PZxoiGl51Bo2z57XeVltclzvcPTCpFI9o266nEpOTrsYVlLQcgfUTE/nxXGLo6pFpdbmqNKQbwlZf47VDjl3epw0utROOxr67KjG85cmx6c29aaiWrMwgnSKn68ILtfY4Zh6o0Pz3OPcjmRVZIMpo/EVjkpodRSu30OFOR35UaPZwTyzOe+GdFWPdtfHmEyXPP70Cz/8/A9fv/sR324TKlsn9l2CIMIPU4Kop1flR3h+jB8kOuWz8mRPEMueRID37xjePZJt3xLefEu0fku8+Y5k+z3J7SNRfylQORz28IJUcoBo0GH1EzFPccTe8L/6lfibv3G+/APzk984++x3HevzP7G++As13OF7gYapg1lpWRpp4/I9yFBRHxVfYry+f2CxKLi5XjEbj4g8l7iMr+hFAWGYHCxiHDcgzXJmszndro2rPMKkjys99dIRKp1gjNYPzK73FJt7knxKmo+5GEzoD2cE8QXuoSzXC3VsR+F5Hu12G6vVIiiB0UCAYwGOpYebjxhf3bJY7VmudoymBVk+ZHA5IYqzJztXGl+m3bFpNptYVosziYpyAV6iEjFMhhirD94wF1ixvmO1vWNZrDWg6/h69Q59csuSVaihunwxL4fgBLlc/AGO9M8RsPFq9zGjxZbF9Y751ZpitaUvduVhPVF9VQ5AgTkqYvFqw2b3Ib3BjI4n0HAgd/h9jKvtA5PiluXNnnmx1ZsH0r84zZ9s/itXA7WZXBGZrO1LxNAO+gLrvweu9p9SCHS9f8P19l5Dy6Ekvb7YBE/D+D+laXIo90Ig+ROszL9NIaGstKV+ZwAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"linux-hosts-file-edit\"\n        title=\"linux-hosts-file-edit\"\n        src=\"/static/725f87402b3ff7b7beed0ce746571631/e5715/mac1.png\"\n        srcset=\"/static/725f87402b3ff7b7beed0ce746571631/a6d36/mac1.png 650w,\n/static/725f87402b3ff7b7beed0ce746571631/e5715/mac1.png 768w,\n/static/725f87402b3ff7b7beed0ce746571631/9685e/mac1.png 1336w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<ol start=\"2\">\n<li>Type <code>sudo vim /etc/hosts</code> in the terminal\n-- It will prompt for the password, enter your administrator password\n-- Enter administrator Password\n</li>\n</ol>\n<p>  <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 52.15384615384615%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA/0lEQVQoz62R22rCQBCGx2jxcOMDWCgUqoKHaINJE2OiInihF56akKbe+/4v8HezniZhpYJefAzM7H77Z0L7wwGjcAtv94PxdyxqBF/g7WLJJIgxXIfwxcwPfjEO93C3EexVAEdgZ6C3+QYlw0fVnqFojFDouShPI5jLLhpeHVrXQa5tgVrmkXof9NE/VhXv8xVedAcVIdM6FvKdL+R1F6WeiaI+kLKkryV9gfYPVJssQI1P+fo1yUBgSZJeKuHpXO5cM9DrdAlqGjJFemhKuPRyKSti8ouQD2UKnohVJUxKtWcKk3Nyhych3w8XkOLiLXH6k9mPuSuhYpfKHT7CH5qFIp4Bf2LYAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"mac-password\"\n        title=\"mac-password\"\n        src=\"/static/02f7704766464a68ca840c7ea423d695/e5715/mac2.png\"\n        srcset=\"/static/02f7704766464a68ca840c7ea423d695/a6d36/mac2.png 650w,\n/static/02f7704766464a68ca840c7ea423d695/e5715/mac2.png 768w,\n/static/02f7704766464a68ca840c7ea423d695/e405b/mac2.png 1566w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p><em>Using the vim text editor you can easily edit you. The macOS hosts file is also similar to the windows and Linux hosts file. I am blocking Facebook and adding custom domain here as well</em>.</p>\n<p>  <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 34.46153846153846%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAHCAYAAAAIy204AAAACXBIWXMAAAsTAAALEwEAmpwYAAAA+klEQVQoz42Q207CUBBFj9LWFnoJQnzAL1BQ6f1+oQUTTfj/z9nOjEBiX+zDykw7c1Z2RplBBcMvsIgb6Psc6jWC2sbT2I16xvBLWGEFMyihfeQinb1nvz2hXdD3hVSeXXfUNiHJCCfu4CQd5mENNz1gETWCR70dtzLj71VxxDLr5R/vOVRZeLdL/6B4aJGM0xiUgh+7JDH9Shbu3wip2YX0VkUwTmiTwApqSWjRPTnZMh9EzCL1cr1pMo2n9htOfoQRtrCzAZvhjGdi05+xbr7gFSdY8QEPUTcJ5VEaO+2h+zXMqIVHcpfEq+oTj+VJ+jndWaMT8M5//ADu/8pmlGD1WgAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"mac-hosts-file-edit\"\n        title=\"mac-hosts-file-edit\"\n        src=\"/static/613a525b29d21509c12da8d4c68919b6/e5715/mac3.png\"\n        srcset=\"/static/613a525b29d21509c12da8d4c68919b6/a6d36/mac3.png 650w,\n/static/613a525b29d21509c12da8d4c68919b6/e5715/mac3.png 768w,\n/static/613a525b29d21509c12da8d4c68919b6/077b7/mac3.png 1166w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<ol start=\"3\">\n<li>Save Changes\nOpen your browser and try to access www.facebook.com and see you can’t access this site.</li>\n</ol>\n<p>  <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 62.153846153846146%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAACXBIWXMAAAsTAAALEwEAmpwYAAAA9ElEQVQoz61TW26DMBDk/P3odSrlKOkHEkKJSYsQtmPj59TriAB5gaJaGu2yDMNod13EGEEIIcA5l+FTHt5EgX8+xejwEejQX5VS1+dXfMJTh6OAtRZlWcIY84w5CZLDNUGKw2Dgvc9u55Fw+81LwXhJwI4MdV2DMYbj4YCmaVBVVa6TeAxTizY57HuO00+L37ZLuYCUCpxLCCFzfwla6209pMjPFm1v0AmLjlv00qVagFBpVTJvw1CQCZeIYBCdSr3UUGcFMwxXzt3arDkkB9+Nx56lYcTb92+sjUsqnzuBjy8BbeciWOzr6lDmpMe15QUYzx8wY7OS8tH6GwAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"edit-hosts-file-mac\"\n        title=\"edit-hosts-file-mac\"\n        src=\"/static/ca2e87ac50ce1b744a0f7f07fc98f479/e5715/mac4.png\"\n        srcset=\"/static/ca2e87ac50ce1b744a0f7f07fc98f479/a6d36/mac4.png 650w,\n/static/ca2e87ac50ce1b744a0f7f07fc98f479/e5715/mac4.png 768w,\n/static/ca2e87ac50ce1b744a0f7f07fc98f479/9f82e/mac4.png 820w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h3 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h3>\n<p>The hosts file is found on all operating systems. The hosts file is a powerful tool. It can make your computer more secure and safer by blocking malicious sites    </p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n</style>","frontmatter":{"date":"July 20, 2020","updated_date":null,"title":"Benefits and usages of Hosts File","tags":["Computer tricks","Networking","Hosts File"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.4184397163120568,"src":"/static/2b2c60ac5ca62d5201374a722f6a3f2f/f422e/index.jpg","srcSet":"/static/2b2c60ac5ca62d5201374a722f6a3f2f/f836f/index.jpg 200w,\n/static/2b2c60ac5ca62d5201374a722f6a3f2f/2244e/index.jpg 400w,\n/static/2b2c60ac5ca62d5201374a722f6a3f2f/f422e/index.jpg 640w","sizes":"(max-width: 640px) 100vw, 640px"}}},"author":{"id":"Vijay Singh Shekhawat","github":"code-vj","avatar":null}}}}]}},"pageContext":{"tag":"Computer tricks"}},"staticQueryHashes":["1171199041","1384082988","2100481360","23180105","528864852"]}