{"id":590637,"date":"2023-09-10T19:00:29","date_gmt":"2023-09-10T16:00:29","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-edit-your-hosts-file-on-windows-mac-or-linux-2\/"},"modified":"2023-09-10T19:00:29","modified_gmt":"2023-09-10T16:00:29","slug":"how-to-edit-your-hosts-file-on-windows-mac-or-linux-2","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-edit-your-hosts-file-on-windows-mac-or-linux-2\/","title":{"rendered":"#How to Edit Your Hosts File on Windows, Mac, or Linux"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2920b28e211\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2920b28e211\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-edit-your-hosts-file-on-windows-mac-or-linux-2\/#Key_Takeaways\" >Key Takeaways<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-edit-your-hosts-file-on-windows-mac-or-linux-2\/#What_is_the_Hosts_File_Used_For\" >What is the Hosts File Used For?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-edit-your-hosts-file-on-windows-mac-or-linux-2\/#Editing_the_Hosts_File_on_Windows_10_or_Windows_11\" >Editing the Hosts File on Windows 10 or Windows 11<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-edit-your-hosts-file-on-windows-mac-or-linux-2\/#Editing_the_Hosts_File_on_Windows_8_or_81\" >Editing the Hosts File on Windows 8 or 8.1<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-edit-your-hosts-file-on-windows-mac-or-linux-2\/#Windows_7\" >Windows 7<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-edit-your-hosts-file-on-windows-mac-or-linux-2\/#Edit_The_Hosts_File_On_Ubuntu\" >Edit The Hosts File On Ubuntu<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-edit-your-hosts-file-on-windows-mac-or-linux-2\/#Change_the_Hosts_File_on_Any_macOS_Version\" >Change the Hosts File on Any macOS Version<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-edit-your-hosts-file-on-windows-mac-or-linux-2\/#Why_Isnt_The_Hosts_File_Blocking_Connections\" >Why Isn&#8217;t The Hosts File Blocking Connections?<\/a><\/li><\/ul><\/nav><\/div>\n<div>\n<section class=\"emaki-custom-block emaki-custom-key-points\">\n<div class=\"emaki-custom key-points\" id=\"custom_block_0\">\n<h3 class=\"title icon i-list\"><span class=\"ez-toc-section\" id=\"Key_Takeaways\"><\/span>Key Takeaways<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"custom_block-content\">\nOn Windows, launch Notepad (or another text editor) as Administrator. Open the hosts file, which is located under C:\\Windows\\System32\\drivers\\etc. On Mac and Linux, edit the \/etc\/hosts file using your text editor as choice \u2014 be sure to launch the editor with sudo.\n <\/div>\n<\/p><\/div>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":0,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":0,\"nbrPlacementsScanned\":0,\"ruleCount\":10,\"degradationStartingPoint\":2,\"actualCount\":241} --><\/section>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":0,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":0,\"nbrPlacementsScanned\":1,\"ruleCount\":10,\"degradationStartingPoint\":2,\"actualCount\":0} --><!-- Zone: below first paragraph. --><br \/>\nOccasionally you may need to edit the hosts file on your machine. Your host file might have been edited maliciously in an attack, or as a prank. Alternatively, you may just want to control access to certain websites or control network traffic.<br \/>\n<!-- Repeatable debug data: {\"injection\":\"before\",\"adPosition\":0,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":0,\"nbrPlacementsScanned\":1,\"ruleCount\":10,\"degradationStartingPoint\":2,\"actualCount\":243} --><!-- Zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"after\",\"adPosition\":1,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":1,\"nbrPlacementsScanned\":1,\"ruleCount\":10,\"degradationStartingPoint\":2,\"actualCount\":0} --><br \/>\n<!-- No winning ad found for zone: native in content! --><\/p>\n<h2 id=\"what-is-the-hosts-file-used-for\"><span class=\"ez-toc-section\" id=\"What_is_the_Hosts_File_Used_For\"><\/span> What is the Hosts File Used For? <span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The hosts file was used to resolve host names for decades before the DNS system was implemented, since way back in the ARPANET days. Since they were used to aide in network name resolution, hosts files grew to become massive documents.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":1,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":1,\"nbrPlacementsScanned\":2,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":235} --><br \/>\nMicrosoft, <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">App<\/a>le, and other operating system developers have kept the hosts file around, which is why it varies very little between Windows, macOS, and Linux. The syntax stays mostly the same across all platforms. Most hosts files will have several entries for loopback. We can use that for the basic example for the typical syntax.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":1,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":1,\"nbrPlacementsScanned\":2,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":567} --><br \/>\nThe first part will be the location to redirect the address to, the second part will be the address that you will want to redirect, and the third part is the comment. They can be separated by a space, but for ease of reading are typically separated by one or two tabs, or the equivalent amount of spaces. The <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/general\/\" data-internallinksmanager029f6b8e52c=\"3\" title=\"General\" target=\"_blank\" rel=\"noopener\">general<\/a> format is:<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":1,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":1,\"nbrPlacementsScanned\":2,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":894} --><\/p>\n<pre>(IP Address) (URL) #(Comment)<\/pre>\n<p><!-- Repeatable debug data: {\"injection\":\"before\",\"adPosition\":1,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":1,\"nbrPlacementsScanned\":2,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":923} --><!-- Zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"after\",\"adPosition\":2,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":2,\"nbrPlacementsScanned\":2,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":0} --><br \/>\nAs a specific example for the loopback address:<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":2,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":2,\"nbrPlacementsScanned\":3,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":48} --><\/p>\n<pre>127.0.0.1 localhosts #loopback<\/pre>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":2,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":2,\"nbrPlacementsScanned\":3,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":78} --><br \/>\nNow let&#8217;s look at accessing the hosts files in different operating systems.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":2,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":2,\"nbrPlacementsScanned\":3,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":157} --><\/p>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":2,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":2,\"nbrPlacementsScanned\":3,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":157} --><\/p>\n<h2 id=\"editing-the-hosts-file-on-windows-10-or-windows-11\"><span class=\"ez-toc-section\" id=\"Editing_the_Hosts_File_on_Windows_10_or_Windows_11\"><\/span> Editing the Hosts File on Windows 10 or Windows 11 <span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The hosts file is still present in the latest and greatest from Microsoft \u2014 Windows 10 and Windows 11 \u2014 despite being ancient by computer standards. It isn&#8217;t used much in in modern Windows networking, however.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":2,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":2,\"nbrPlacementsScanned\":3,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":382} --><br \/>\nThe Windows hosts file, like other files that can be found in the Windows folder, is protected. You need administrative privileges to move, edit, or delete the file.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":2,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":2,\"nbrPlacementsScanned\":3,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":547} --><br \/>\nYou can use any plain text editor you want to modify the hosts file, however Notepad is perfectly adequate for the task. You don&#8217;t need to go download another one just for this job.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":2,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":2,\"nbrPlacementsScanned\":3,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":732} --><br \/>\nHit the Start button, type &#8220;notepad&#8221; into the search, and then right-click it and hit &#8220;Run as Administrator.&#8221;<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":2,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":2,\"nbrPlacementsScanned\":3,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":861} --><\/p>\n<div class=\"body-img landscape\">\n<div class=\"responsive-img image-expandable img-article-item\" style=\"padding-bottom:74%\" data-img-url=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/launch-notepad-as-administrator-windows-11.png\" data-modal-id=\"single-image-modal\" data-modal-container-id=\"single-image-modal-container\" data-img-caption=\"null\">\n<figure><picture><!--[if IE 9]> <video style=\"display: none;\"><![endif]--><source media=\"(min-width: 1024px)\" sizes=\"750px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/launch-notepad-as-administrator-windows-11.png?q=50&amp;fit=crop&amp;w=750&amp;dpr=1.5\"\/><source media=\"(min-width: 768px)\" sizes=\"943px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/launch-notepad-as-administrator-windows-11.png?q=50&amp;fit=crop&amp;w=943&amp;dpr=1.5\"\/><source media=\"(min-width: 481px)\" sizes=\"767px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/launch-notepad-as-administrator-windows-11.png?q=50&amp;fit=crop&amp;w=767&amp;dpr=1.5\"\/><source media=\"(min-width: 0px)\" sizes=\"480px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/launch-notepad-as-administrator-windows-11.png?q=50&amp;fit=crop&amp;w=480&amp;dpr=1.5\"\/><!--[if IE 9]><\/video><![endif]--><img loading=\"lazy\" decoding=\"async\" width=\"500\" class=\"lazyload\" height=\"370\" alt=\"Open the Start menu, type \" notepad=\"\" into=\"\" the=\"\" search=\"\" and=\"\" then=\"\" click=\"\" as=\"\" administrator.=\"\" style=\"display:block;height:auto;max-width:100%;\" src=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/launch-notepad-as-administrator-windows-11.png\"\/><\/picture><\/figure>\n<\/div><\/div>\n<p><!-- Repeatable debug data: {\"injection\":\"before\",\"adPosition\":2,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":2,\"nbrPlacementsScanned\":3,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":1101} --><!-- Zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"after\",\"adPosition\":3,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":3,\"nbrPlacementsScanned\":3,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":0} --><br \/>\nClick on &#8220;File&#8221; in the top left corner, hit &#8220;Open,&#8221; and then navigate to the Windows hosts file&#8217;s location:<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":3,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":3,\"nbrPlacementsScanned\":4,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":131} --><\/p>\n<pre>C:\\Windows\\System32\\drivers\\etc<\/pre>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":3,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":3,\"nbrPlacementsScanned\":4,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":162} --><br \/>\nMake sure to change the select to &#8220;All Files (*.*)&#8221; rather than &#8220;Text Documents (*.txt).&#8221; The hosts file doesn&#8217;t have a file extension, so it won&#8217;t show up if you&#8217;re only displaying text documents. After you change that setting, locate the &#8220;hosts&#8221; fileand click open.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":3,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":3,\"nbrPlacementsScanned\":4,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":471} --><\/p>\n<div class=\"body-img landscape\">\n<div class=\"responsive-img image-expandable img-article-item\" style=\"padding-bottom:67.076923076923%\" data-img-url=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/open-the-hosts-file-with-notepad.png\" data-modal-id=\"single-image-modal\" data-modal-container-id=\"single-image-modal-container\" data-img-caption=\"null\">\n<figure><picture><!--[if IE 9]> <video style=\"display: none;\"><![endif]--><source media=\"(min-width: 1024px)\" sizes=\"750px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/open-the-hosts-file-with-notepad.png?q=50&amp;fit=crop&amp;w=750&amp;dpr=1.5\"\/><source media=\"(min-width: 768px)\" sizes=\"943px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/open-the-hosts-file-with-notepad.png?q=50&amp;fit=crop&amp;w=943&amp;dpr=1.5\"\/><source media=\"(min-width: 481px)\" sizes=\"767px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/open-the-hosts-file-with-notepad.png?q=50&amp;fit=crop&amp;w=767&amp;dpr=1.5\"\/><source media=\"(min-width: 0px)\" sizes=\"480px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/open-the-hosts-file-with-notepad.png?q=50&amp;fit=crop&amp;w=480&amp;dpr=1.5\"\/><!--[if IE 9]><\/video><![endif]--><img loading=\"lazy\" decoding=\"async\" width=\"650\" class=\"lazyload\" height=\"436\" alt=\"Open the hosts file with Notepad. Make sure to change it to \" all=\"\" files.=\"\" style=\"display:block;height:auto;max-width:100%;\" src=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/open-the-hosts-file-with-notepad.png\"\/><\/picture><\/figure>\n<\/div><\/div>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":3,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":3,\"nbrPlacementsScanned\":4,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":711} --><br \/>\nYou can then edit the hosts file however you&#8217;d like. There are a few obvious things to do with it, like block or reroute internet traffic.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":3,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":3,\"nbrPlacementsScanned\":4,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":853} --><\/p>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":3,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":3,\"nbrPlacementsScanned\":4,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":853} --><\/p>\n<h2 id=\"editing-the-hosts-file-on-windows-8-or-8-1\"><span class=\"ez-toc-section\" id=\"Editing_the_Hosts_File_on_Windows_8_or_81\"><\/span> Editing the Hosts File on Windows 8 or 8.1 <span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Editing the hosts file on Windows 8 and 8.1 is basically the same as Windows 10 or 11.<br \/>\n<!-- Repeatable debug data: {\"injection\":\"before\",\"adPosition\":3,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":3,\"nbrPlacementsScanned\":4,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":939} --><!-- Zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"after\",\"adPosition\":4,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":4,\"nbrPlacementsScanned\":4,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":0} --><br \/>\nJust search for Notepad, right-click on Notepad in the search results list, and then choose &#8220;Run as Administrator.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":4,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":4,\"nbrPlacementsScanned\":5,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":119} --><\/p>\n<div class=\"body-img landscape\">\n<div class=\"responsive-img image-expandable img-article-item\" style=\"padding-bottom:56.923076923077%\" data-img-url=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2014\/01\/img_52e68b62d824b.png\" data-modal-id=\"single-image-modal\" data-modal-container-id=\"single-image-modal-container\" data-img-caption=\"null\">\n<figure><picture><!--[if IE 9]> <video style=\"display: none;\"><![endif]--><source media=\"(min-width: 1024px)\" sizes=\"750px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2014\/01\/img_52e68b62d824b.png?q=50&amp;fit=crop&amp;w=750&amp;dpr=1.5\"\/><source media=\"(min-width: 768px)\" sizes=\"943px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2014\/01\/img_52e68b62d824b.png?q=50&amp;fit=crop&amp;w=943&amp;dpr=1.5\"\/><source media=\"(min-width: 481px)\" sizes=\"767px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2014\/01\/img_52e68b62d824b.png?q=50&amp;fit=crop&amp;w=767&amp;dpr=1.5\"\/><source media=\"(min-width: 0px)\" sizes=\"480px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2014\/01\/img_52e68b62d824b.png?q=50&amp;fit=crop&amp;w=480&amp;dpr=1.5\"\/><!--[if IE 9]><\/video><![endif]--><img loading=\"lazy\" decoding=\"async\" width=\"650\" class=\"lazyload\" height=\"370\" alt=\"\" style=\"display:block;height:auto;max-width:100%;\" src=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2014\/01\/img_52e68b62d824b.png\"\/><\/picture><\/figure>\n<\/div><\/div>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":4,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":4,\"nbrPlacementsScanned\":5,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":359} --><br \/>\nOnce you&#8217;ve opened Notepad, click &#8220;File&#8221; in the top right, click &#8220;Open,&#8221; and then navigate to the \/etc\/ folder:<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":4,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":4,\"nbrPlacementsScanned\":5,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":494} --><\/p>\n<pre>C:\\Windows\\System32\\drivers\\etc\\hosts<\/pre>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":4,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":4,\"nbrPlacementsScanned\":5,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":531} --><\/p>\n<div class=\"body-img landscape\">\n<div class=\"responsive-img image-expandable img-article-item\" style=\"padding-bottom:53.743315508021%\" data-img-url=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2015\/02\/Windows_104.png\" data-modal-id=\"single-image-modal\" data-modal-container-id=\"single-image-modal-container\" data-img-caption=\"null\">\n<figure><picture><!--[if IE 9]> <video style=\"display: none;\"><![endif]--><source media=\"(min-width: 1024px)\" sizes=\"750px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2015\/02\/Windows_104.png?q=50&amp;fit=crop&amp;w=750&amp;dpr=1.5\"\/><source media=\"(min-width: 768px)\" sizes=\"943px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2015\/02\/Windows_104.png?q=50&amp;fit=crop&amp;w=943&amp;dpr=1.5\"\/><source media=\"(min-width: 481px)\" sizes=\"767px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2015\/02\/Windows_104.png?q=50&amp;fit=crop&amp;w=767&amp;dpr=1.5\"\/><source media=\"(min-width: 0px)\" sizes=\"480px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2015\/02\/Windows_104.png?q=50&amp;fit=crop&amp;w=480&amp;dpr=1.5\"\/><!--[if IE 9]><\/video><![endif]--><img loading=\"lazy\" decoding=\"async\" width=\"748\" class=\"lazyload\" height=\"402\" alt=\"Windows_10\" style=\"display:block;height:auto;max-width:100%;\" src=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2015\/02\/Windows_104.png\"\/><\/picture><\/figure>\n<\/div><\/div>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":4,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":4,\"nbrPlacementsScanned\":5,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":771} --><br \/>\nYou&#8217;ll be able to edit the hosts file like you would any other file. You can use it to block access to websites, if you want.<br \/>\n<!-- Repeatable debug data: {\"injection\":\"before\",\"adPosition\":4,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":4,\"nbrPlacementsScanned\":5,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":900} --><!-- Zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"after\",\"adPosition\":5,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":5,\"nbrPlacementsScanned\":5,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":0} --><\/p>\n<section class=\"emaki-custom-block emaki-custom-tip\">\n<div class=\"emaki-custom tip\" id=\"custom_block_29\">\n<div class=\"custom_block-content\">\nIf you get an error notifying you that you don&#8217;t have permission, you didn&#8217;t actually run Notepad as administrator.\n <\/div>\n<\/p><\/div>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":5,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":5,\"nbrPlacementsScanned\":6,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":240} --><\/section>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":5,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":5,\"nbrPlacementsScanned\":6,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":240} --><\/p>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":5,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":5,\"nbrPlacementsScanned\":6,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":240} --><\/p>\n<h2 id=\"windows-7\"><span class=\"ez-toc-section\" id=\"Windows_7\"><\/span> Windows 7 <span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Accessing the hosts file in Windows 7 is the same as on newer versions of Windows. You need to run Notepad as administrator, navigate to the hosts file, and then open it up.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":5,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":5,\"nbrPlacementsScanned\":6,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":413} --><br \/>\nThere are a few ways you can do this. The first is to find Notepad, right-click it, hit &#8220;Run as Administrator,&#8221; and then navigate to the hosts file. It is located at:<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":5,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":5,\"nbrPlacementsScanned\":6,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":589} --><\/p>\n<pre>C:\\Windows\\system32\\drivers\\etc\\<\/pre>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":5,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":5,\"nbrPlacementsScanned\":6,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":621} --><br \/>\nAlternatively, you can hit Windows+R to open up a Run window, and then enter the following command:<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":5,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":5,\"nbrPlacementsScanned\":6,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":720} --><\/p>\n<pre>notepad c:\\windows\\system32\\drivers\\etc\\hosts<\/pre>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":5,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":5,\"nbrPlacementsScanned\":6,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":765} --><\/p>\n<div class=\"body-img landscape\">\n<div class=\"responsive-img image-expandable img-article-item\" style=\"padding-bottom:57.802197802198%\" data-img-url=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831194119.png\" data-modal-id=\"single-image-modal\" data-modal-container-id=\"single-image-modal-container\" data-img-caption=\"null\">\n<figure><picture><!--[if IE 9]> <video style=\"display: none;\"><![endif]--><source media=\"(min-width: 1024px)\" sizes=\"750px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831194119.png?q=50&amp;fit=crop&amp;w=750&amp;dpr=1.5\"\/><source media=\"(min-width: 768px)\" sizes=\"943px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831194119.png?q=50&amp;fit=crop&amp;w=943&amp;dpr=1.5\"\/><source media=\"(min-width: 481px)\" sizes=\"767px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831194119.png?q=50&amp;fit=crop&amp;w=767&amp;dpr=1.5\"\/><source media=\"(min-width: 0px)\" sizes=\"480px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831194119.png?q=50&amp;fit=crop&amp;w=480&amp;dpr=1.5\"\/><!--[if IE 9]><\/video><![endif]--><img loading=\"lazy\" decoding=\"async\" width=\"455\" class=\"lazyload\" height=\"263\" alt=\"sshot-2010-08-31-[19-41-19]\" style=\"display:block;height:auto;max-width:100%;\" src=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831194119.png\"\/><\/picture><\/figure>\n<\/div><\/div>\n<p><!-- Repeatable debug data: {\"injection\":\"before\",\"adPosition\":5,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":5,\"nbrPlacementsScanned\":6,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":1005} --><!-- Zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"after\",\"adPosition\":6,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":6,\"nbrPlacementsScanned\":6,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":0} --><br \/>\nThe command will run Notepad as administrator and automatically open the specified file.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":6,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":6,\"nbrPlacementsScanned\":7,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":88} --><br \/>\nOnce notepad is open you can edit the file. In this example we will block <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/social-mediaa\/\" data-internallinksmanager029f6b8e52c=\"1\" title=\"Social Media\" target=\"_blank\" rel=\"noopener\">Facebook<\/a>. To do this just enter in the following after the # mark.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":6,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":6,\"nbrPlacementsScanned\":7,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":228} --><\/p>\n<pre>0.0.0.0 <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/www.facebook.com\">www.facebook.com<\/a> <\/pre>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":6,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":6,\"nbrPlacementsScanned\":7,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":253} --><\/p>\n<section class=\"emaki-custom-block emaki-custom-note\">\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":6,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":6,\"nbrPlacementsScanned\":7,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":493} --><\/section>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":6,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":6,\"nbrPlacementsScanned\":7,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":493} --><\/p>\n<div class=\"body-img landscape\">\n<div class=\"responsive-img image-expandable img-article-item\" style=\"padding-bottom:64.992150706436%\" data-img-url=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831205149.png\" data-modal-id=\"single-image-modal\" data-modal-container-id=\"single-image-modal-container\" data-img-caption=\"null\">\n<figure><picture><!--[if IE 9]> <video style=\"display: none;\"><![endif]--><source media=\"(min-width: 1024px)\" sizes=\"750px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831205149.png?q=50&amp;fit=crop&amp;w=750&amp;dpr=1.5\"\/><source media=\"(min-width: 768px)\" sizes=\"943px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831205149.png?q=50&amp;fit=crop&amp;w=943&amp;dpr=1.5\"\/><source media=\"(min-width: 481px)\" sizes=\"767px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831205149.png?q=50&amp;fit=crop&amp;w=767&amp;dpr=1.5\"\/><source media=\"(min-width: 0px)\" sizes=\"480px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831205149.png?q=50&amp;fit=crop&amp;w=480&amp;dpr=1.5\"\/><!--[if IE 9]><\/video><![endif]--><img loading=\"lazy\" decoding=\"async\" width=\"637\" class=\"lazyload\" height=\"414\" alt=\"sshot-2010-08-31-[20-51-49]\" style=\"display:block;height:auto;max-width:100%;\" src=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831205149.png\"\/><\/picture><\/figure>\n<\/div><\/div>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":6,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":6,\"nbrPlacementsScanned\":7,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":733} --><br \/>\nNow that you have edited your Hosts file make sure to save it.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":6,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":6,\"nbrPlacementsScanned\":7,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":795} --><\/p>\n<div class=\"body-img landscape\">\n<div class=\"responsive-img image-expandable img-article-item\" style=\"padding-bottom:64.992150706436%\" data-img-url=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831205407.png\" data-modal-id=\"single-image-modal\" data-modal-container-id=\"single-image-modal-container\" data-img-caption=\"null\">\n<figure><picture><!--[if IE 9]> <video style=\"display: none;\"><![endif]--><source media=\"(min-width: 1024px)\" sizes=\"750px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831205407.png?q=50&amp;fit=crop&amp;w=750&amp;dpr=1.5\"\/><source media=\"(min-width: 768px)\" sizes=\"943px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831205407.png?q=50&amp;fit=crop&amp;w=943&amp;dpr=1.5\"\/><source media=\"(min-width: 481px)\" sizes=\"767px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831205407.png?q=50&amp;fit=crop&amp;w=767&amp;dpr=1.5\"\/><source media=\"(min-width: 0px)\" sizes=\"480px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831205407.png?q=50&amp;fit=crop&amp;w=480&amp;dpr=1.5\"\/><!--[if IE 9]><\/video><![endif]--><img loading=\"lazy\" decoding=\"async\" width=\"637\" class=\"lazyload\" height=\"414\" alt=\"sshot-2010-08-31-[20-54-07]\" style=\"display:block;height:auto;max-width:100%;\" src=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831205407.png\"\/><\/picture><\/figure>\n<\/div><\/div>\n<p><!-- Repeatable debug data: {\"injection\":\"before\",\"adPosition\":6,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":6,\"nbrPlacementsScanned\":7,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":1035} --><!-- Zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"after\",\"adPosition\":7,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":7,\"nbrPlacementsScanned\":7,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":0} --><br \/>\nNow notice if we try to access Facebook in IE we can&#8217;t get to the page.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":7,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":7,\"nbrPlacementsScanned\":8,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":75} --><\/p>\n<div class=\"body-img landscape\">\n<div class=\"responsive-img image-expandable img-article-item\" style=\"padding-bottom:64.625850340136%\" data-img-url=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831205644.png\" data-modal-id=\"single-image-modal\" data-modal-container-id=\"single-image-modal-container\" data-img-caption=\"null\">\n<figure><picture><!--[if IE 9]> <video style=\"display: none;\"><![endif]--><source media=\"(min-width: 1024px)\" sizes=\"750px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831205644.png?q=50&amp;fit=crop&amp;w=750&amp;dpr=1.5\"\/><source media=\"(min-width: 768px)\" sizes=\"943px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831205644.png?q=50&amp;fit=crop&amp;w=943&amp;dpr=1.5\"\/><source media=\"(min-width: 481px)\" sizes=\"767px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831205644.png?q=50&amp;fit=crop&amp;w=767&amp;dpr=1.5\"\/><source media=\"(min-width: 0px)\" sizes=\"480px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831205644.png?q=50&amp;fit=crop&amp;w=480&amp;dpr=1.5\"\/><!--[if IE 9]><\/video><![endif]--><img loading=\"lazy\" decoding=\"async\" width=\"588\" class=\"lazyload\" height=\"380\" alt=\"sshot-2010-08-31-[20-56-44]\" style=\"display:block;height:auto;max-width:100%;\" src=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831205644.png\"\/><\/picture><\/figure>\n<\/div><\/div>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":7,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":7,\"nbrPlacementsScanned\":8,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":315} --><br \/>\nWe also were not able to get to it in Google Chrome&#8230; (check notes at the end). Also for more info on editing your Hosts file, check out The Geek&#8217;s article on how to create a shortcut to quickly edit your Hosts file.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":7,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":7,\"nbrPlacementsScanned\":8,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":536} --><\/p>\n<div class=\"body-img landscape\">\n<div class=\"responsive-img image-expandable img-article-item\" style=\"padding-bottom:80.46875%\" data-img-url=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831210427.png\" data-modal-id=\"single-image-modal\" data-modal-container-id=\"single-image-modal-container\" data-img-caption=\"null\">\n<figure><picture><!--[if IE 9]> <video style=\"display: none;\"><![endif]--><source media=\"(min-width: 1024px)\" sizes=\"750px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831210427.png?q=50&amp;fit=crop&amp;w=750&amp;dpr=1.5\"\/><source media=\"(min-width: 768px)\" sizes=\"943px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831210427.png?q=50&amp;fit=crop&amp;w=943&amp;dpr=1.5\"\/><source media=\"(min-width: 481px)\" sizes=\"767px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831210427.png?q=50&amp;fit=crop&amp;w=767&amp;dpr=1.5\"\/><source media=\"(min-width: 0px)\" sizes=\"480px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831210427.png?q=50&amp;fit=crop&amp;w=480&amp;dpr=1.5\"\/><!--[if IE 9]><\/video><![endif]--><img loading=\"lazy\" decoding=\"async\" width=\"512\" class=\"lazyload\" height=\"412\" alt=\"sshot-2010-08-31-[21-04-27]\" style=\"display:block;height:auto;max-width:100%;\" src=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2010\/08\/sshot20100831210427.png\"\/><\/picture><\/figure>\n<\/div><\/div>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":7,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":7,\"nbrPlacementsScanned\":8,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":776} --><\/p>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":7,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":7,\"nbrPlacementsScanned\":8,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":776} --><\/p>\n<h2 id=\"edit-the-hosts-file-on-ubuntu\"><span class=\"ez-toc-section\" id=\"Edit_The_Hosts_File_On_Ubuntu\"><\/span> Edit The Hosts File On Ubuntu <span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In Ubuntu (and most Linux distributions) you can edit the hosts file directly in the Terminal. You can use your favorite command-line editor or your favorite GUI text editor. For this example we will use Vim, since it is one of the traditional text editors in Linux. Ubuntu&#8217;s hosts file location is the \/etc\/ folder. The hosts file is protected, much like in Windows, and your regular user account will not be able to edit it.<br \/>\n<!-- Repeatable debug data: {\"injection\":\"before\",\"adPosition\":7,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":7,\"nbrPlacementsScanned\":8,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":1206} --><!-- Zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"after\",\"adPosition\":8,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":8,\"nbrPlacementsScanned\":8,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":0} --><br \/>\nYou&#8217;ll need to launch Vim prefaced by sudo, which is conceptually and functionally similar to &#8220;Run as Administrator&#8221; on Windows operating systems. Open up a Terminal, then enter:<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":8,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":8,\"nbrPlacementsScanned\":9,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":192} --><\/p>\n<pre>sudo vim \/etc\/hosts<\/pre>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":8,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":8,\"nbrPlacementsScanned\":9,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":211} --><br \/>\nYou&#8217;ll need to enter your password before the command will execute.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":8,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":8,\"nbrPlacementsScanned\":9,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":282} --><\/p>\n<section class=\"emaki-custom-block emaki-custom-note\">\n<div class=\"emaki-custom note\" id=\"custom_block_53\">\n<div class=\"custom_block-content\">\nIf you get a message notifying you that Vim is not installed, just run &#8220;sudo apt install vim&#8221; in a Terminal.\n <\/div>\n<\/p><\/div>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":8,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":8,\"nbrPlacementsScanned\":9,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":522} --><\/section>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":8,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":8,\"nbrPlacementsScanned\":9,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":522} --><\/p>\n<div class=\"body-img landscape\">\n<div class=\"responsive-img image-expandable img-article-item\" style=\"padding-bottom:75.454545454545%\" data-img-url=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/ubuntu.png\" data-modal-id=\"single-image-modal\" data-modal-container-id=\"single-image-modal-container\" data-img-caption=\"null\">\n<figure><picture><!--[if IE 9]> <video style=\"display: none;\"><![endif]--><source media=\"(min-width: 1024px)\" sizes=\"750px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/ubuntu.png?q=50&amp;fit=crop&amp;w=750&amp;dpr=1.5\"\/><source media=\"(min-width: 768px)\" sizes=\"943px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/ubuntu.png?q=50&amp;fit=crop&amp;w=943&amp;dpr=1.5\"\/><source media=\"(min-width: 481px)\" sizes=\"767px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/ubuntu.png?q=50&amp;fit=crop&amp;w=767&amp;dpr=1.5\"\/><source media=\"(min-width: 0px)\" sizes=\"480px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/ubuntu.png?q=50&amp;fit=crop&amp;w=480&amp;dpr=1.5\"\/><!--[if IE 9]><\/video><![endif]--><img loading=\"lazy\" decoding=\"async\" width=\"550\" class=\"lazyload\" height=\"415\" alt=\"Run \" sudo=\"\" vim=\"\" in=\"\" a=\"\" terminal.=\"\" style=\"display:block;height:auto;max-width:100%;\" src=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/ubuntu.png\"\/><\/picture><\/figure>\n<\/div><\/div>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":8,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":8,\"nbrPlacementsScanned\":9,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":762} --><br \/>\nNow that it is open we can edit it to redirect Facebook into nothing. You will notice that with Ubuntu there is also a section for IPv6.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":8,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":8,\"nbrPlacementsScanned\":9,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":898} --><br \/>\nYou can ignore the IPv6 section in most cases; just editing the IPv4 section should do what you need.<br \/>\n<!-- Repeatable debug data: {\"injection\":\"before\",\"adPosition\":8,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":8,\"nbrPlacementsScanned\":9,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":999} --><!-- Zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"after\",\"adPosition\":9,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":9,\"nbrPlacementsScanned\":9,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":0} --><\/p>\n<div class=\"body-img landscape\">\n<div class=\"responsive-img image-expandable img-article-item\" style=\"padding-bottom:75.204359673025%\" data-img-url=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/block-facebook.png\" data-modal-id=\"single-image-modal\" data-modal-container-id=\"single-image-modal-container\" data-img-caption=\"null\">\n<figure><picture><!--[if IE 9]> <video style=\"display: none;\"><![endif]--><source media=\"(min-width: 1024px)\" sizes=\"750px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/block-facebook.png?q=50&amp;fit=crop&amp;w=750&amp;dpr=1.5\"\/><source media=\"(min-width: 768px)\" sizes=\"943px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/block-facebook.png?q=50&amp;fit=crop&amp;w=943&amp;dpr=1.5\"\/><source media=\"(min-width: 481px)\" sizes=\"767px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/block-facebook.png?q=50&amp;fit=crop&amp;w=767&amp;dpr=1.5\"\/><source media=\"(min-width: 0px)\" sizes=\"480px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/block-facebook.png?q=50&amp;fit=crop&amp;w=480&amp;dpr=1.5\"\/><!--[if IE 9]><\/video><![endif]--><img loading=\"lazy\" decoding=\"async\" width=\"734\" class=\"lazyload\" height=\"552\" alt=\"An entry in the hosts file that will block Facebook.\" style=\"display:block;height:auto;max-width:100%;\" src=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/block-facebook.png\"\/><\/picture><\/figure>\n<\/div><\/div>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":9,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":9,\"nbrPlacementsScanned\":10,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":240} --><br \/>\nNow we can save the file and try to go to Facebook.com. When you set the address in the hosts file to 0.0.0.0, your computer can&#8217;t reach Facebook, and throws an error: &#8220;Unable to Connect.&#8221;<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":9,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":9,\"nbrPlacementsScanned\":10,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":442} --><\/p>\n<div class=\"body-img landscape\">\n<div class=\"responsive-img image-expandable img-article-item\" style=\"padding-bottom:78.003120124805%\" data-img-url=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/unable-to-ocnnect.png\" data-modal-id=\"single-image-modal\" data-modal-container-id=\"single-image-modal-container\" data-img-caption=\"null\">\n<figure><picture><!--[if IE 9]> <video style=\"display: none;\"><![endif]--><source media=\"(min-width: 1024px)\" sizes=\"750px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/unable-to-ocnnect.png?q=50&amp;fit=crop&amp;w=750&amp;dpr=1.5\"\/><source media=\"(min-width: 768px)\" sizes=\"943px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/unable-to-ocnnect.png?q=50&amp;fit=crop&amp;w=943&amp;dpr=1.5\"\/><source media=\"(min-width: 481px)\" sizes=\"767px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/unable-to-ocnnect.png?q=50&amp;fit=crop&amp;w=767&amp;dpr=1.5\"\/><source media=\"(min-width: 0px)\" sizes=\"480px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/unable-to-ocnnect.png?q=50&amp;fit=crop&amp;w=480&amp;dpr=1.5\"\/><!--[if IE 9]><\/video><![endif]--><img loading=\"lazy\" decoding=\"async\" width=\"641\" class=\"lazyload\" height=\"500\" alt=\"The browser cannot connect to Facebook.com.\" style=\"display:block;height:auto;max-width:100%;\" src=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/unable-to-ocnnect.png\"\/><\/picture><\/figure>\n<\/div><\/div>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":9,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":9,\"nbrPlacementsScanned\":10,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":682} --><\/p>\n<section class=\"emaki-custom-block emaki-custom-note\">\n<div class=\"emaki-custom note\" id=\"custom_block_60\">\n<div class=\"custom_block-content\">\nIf your browser has been configured to use DNS Over HTTPS and its own DNS Server, editing the hosts file will probably not block access.\n <\/div>\n<\/p><\/div>\n<p><!-- Repeatable debug data: {\"injection\":\"before\",\"adPosition\":9,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":9,\"nbrPlacementsScanned\":10,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":922} --><!-- Zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"after\",\"adPosition\":10,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":10,\"nbrPlacementsScanned\":10,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":0} --><\/section>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":10,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":10,\"nbrPlacementsScanned\":11,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":0} --><\/p>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":10,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":10,\"nbrPlacementsScanned\":11,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":0} --><\/p>\n<h2 id=\"change-the-hosts-file-on-any-macos-version\"><span class=\"ez-toc-section\" id=\"Change_the_Hosts_File_on_Any_macOS_Version\"><\/span> Change the Hosts File on Any macOS Version <span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In macOS, accessing the hosts file is very similar to Ubuntu. Begin in terminal and use your favorite editor \u2014 it could even be a GUI-based text editor if you wish, but it is easier to use a command-line editor from the Terminal.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":10,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":10,\"nbrPlacementsScanned\":11,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":236} --><br \/>\nThe hosts file on macOS is located in <code>\/etc\/<\/code> just like on Linux.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":10,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":10,\"nbrPlacementsScanned\":11,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":300} --><\/p>\n<div class=\"body-img landscape\">\n<div class=\"responsive-img image-expandable img-article-item\" style=\"padding-bottom:65.466666666667%\" data-img-url=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2023\/09\/sudo-vi-mac.png\" data-modal-id=\"single-image-modal\" data-modal-container-id=\"single-image-modal-container\" data-img-caption=\"null\">\n<figure><picture><!--[if IE 9]> <video style=\"display: none;\"><![endif]--><source media=\"(min-width: 1024px)\" sizes=\"750px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2023\/09\/sudo-vi-mac.png?q=50&amp;fit=crop&amp;w=750&amp;dpr=1.5\"\/><source media=\"(min-width: 768px)\" sizes=\"943px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2023\/09\/sudo-vi-mac.png?q=50&amp;fit=crop&amp;w=943&amp;dpr=1.5\"\/><source media=\"(min-width: 481px)\" sizes=\"767px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2023\/09\/sudo-vi-mac.png?q=50&amp;fit=crop&amp;w=767&amp;dpr=1.5\"\/><source media=\"(min-width: 0px)\" sizes=\"480px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2023\/09\/sudo-vi-mac.png?q=50&amp;fit=crop&amp;w=480&amp;dpr=1.5\"\/><!--[if IE 9]><\/video><![endif]--><img loading=\"lazy\" decoding=\"async\" width=\"750\" class=\"lazyload\" height=\"491\" alt=\"Running vi as sudo user on a Mac. \" style=\"display:block;height:auto;max-width:100%;\" src=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2023\/09\/sudo-vi-mac.png\"\/><\/picture><\/figure>\n<\/div><\/div>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":10,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":10,\"nbrPlacementsScanned\":11,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":540} --><br \/>\nThe file will look a lot like the hosts file found in Windows and Linux. Again we are going to redirect Facebook to 0.0.0.0.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":10,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":10,\"nbrPlacementsScanned\":11,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":664} --><\/p>\n<div class=\"body-img landscape\">\n<div class=\"responsive-img image-expandable img-article-item\" style=\"padding-bottom:65.066666666667%\" data-img-url=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2023\/09\/screenshot-2023-09-10-at-12-26-06-am.png\" data-modal-id=\"single-image-modal\" data-modal-container-id=\"single-image-modal-container\" data-img-caption=\"null\">\n<figure><picture><!--[if IE 9]> <video style=\"display: none;\"><![endif]--><source media=\"(min-width: 1024px)\" sizes=\"750px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2023\/09\/screenshot-2023-09-10-at-12-26-06-am.png?q=50&amp;fit=crop&amp;w=750&amp;dpr=1.5\"\/><source media=\"(min-width: 768px)\" sizes=\"943px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2023\/09\/screenshot-2023-09-10-at-12-26-06-am.png?q=50&amp;fit=crop&amp;w=943&amp;dpr=1.5\"\/><source media=\"(min-width: 481px)\" sizes=\"767px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2023\/09\/screenshot-2023-09-10-at-12-26-06-am.png?q=50&amp;fit=crop&amp;w=767&amp;dpr=1.5\"\/><source media=\"(min-width: 0px)\" sizes=\"480px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2023\/09\/screenshot-2023-09-10-at-12-26-06-am.png?q=50&amp;fit=crop&amp;w=480&amp;dpr=1.5\"\/><!--[if IE 9]><\/video><![endif]--><img loading=\"lazy\" decoding=\"async\" width=\"750\" class=\"lazyload\" height=\"488\" alt=\"The Hosts file on macOS Ventura. \" style=\"display:block;height:auto;max-width:100%;\" src=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2023\/09\/screenshot-2023-09-10-at-12-26-06-am.png\"\/><\/picture><\/figure>\n<\/div><\/div>\n<p><!-- Repeatable debug data: {\"injection\":\"before\",\"adPosition\":10,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":10,\"nbrPlacementsScanned\":11,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":904} --><!-- Zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"after\",\"adPosition\":11,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":11,\"nbrPlacementsScanned\":11,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":0} --><br \/>\nSafari, just like a browser on Windows and Ubuntu, will be unable to connect to Facebook.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":11,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":11,\"nbrPlacementsScanned\":12,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":89} --><\/p>\n<div class=\"body-img landscape\">\n<div class=\"responsive-img image-expandable img-article-item\" style=\"padding-bottom:62.757731958763%\" data-img-url=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/safari-cannot-connect-to-acebook.png\" data-modal-id=\"single-image-modal\" data-modal-container-id=\"single-image-modal-container\" data-img-caption=\"null\">\n<figure><picture><!--[if IE 9]> <video style=\"display: none;\"><![endif]--><source media=\"(min-width: 1024px)\" sizes=\"750px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/safari-cannot-connect-to-acebook.png?q=50&amp;fit=crop&amp;w=750&amp;dpr=1.5\"\/><source media=\"(min-width: 768px)\" sizes=\"943px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/safari-cannot-connect-to-acebook.png?q=50&amp;fit=crop&amp;w=943&amp;dpr=1.5\"\/><source media=\"(min-width: 481px)\" sizes=\"767px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/safari-cannot-connect-to-acebook.png?q=50&amp;fit=crop&amp;w=767&amp;dpr=1.5\"\/><source media=\"(min-width: 0px)\" sizes=\"480px\" data-srcset=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/safari-cannot-connect-to-acebook.png?q=50&amp;fit=crop&amp;w=480&amp;dpr=1.5\"\/><!--[if IE 9]><\/video><![endif]--><img loading=\"lazy\" decoding=\"async\" width=\"776\" class=\"lazyload\" height=\"487\" alt=\"Safari's connection to Facebook was blocked.\" style=\"display:block;height:auto;max-width:100%;\" src=\"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2017\/04\/safari-cannot-connect-to-acebook.png\"\/><\/picture><\/figure>\n<\/div><\/div>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":11,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":11,\"nbrPlacementsScanned\":12,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":329} --><\/p>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":11,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":11,\"nbrPlacementsScanned\":12,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":329} --><\/p>\n<h2 id=\"why-isn-39-t-the-hosts-file-blocking-connections\"><span class=\"ez-toc-section\" id=\"Why_Isnt_The_Hosts_File_Blocking_Connections\"><\/span> Why Isn&#8217;t The Hosts File Blocking Connections? <span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>All of the major modern browsers offer DNS Over HTTPS (DOH). DOH encrypts your DNS requests so that they can&#8217;t be intercepted and read by third parties that might be snooping &#8212; in general, this is a great thing.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":11,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":11,\"nbrPlacementsScanned\":12,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":546} --><br \/>\nFor our purposes here, it limits the utility of the hosts file. The hosts file can <strong>only <\/strong>be used to block internet traffic if your browser is deferring to the DNS Server specified in the Windows operating system. A lot of browsers will enable DNS Over HTTPS automatically and use their own DNS servers. That results in the browser completely bypassing the hosts file. It is possible to force your browser to use the DNS Server Windows specifies, but you&#8217;ll have to dig through your browser&#8217;s settings.<br \/>\n<!-- Repeatable debug data: {\"injection\":\"before\",\"adPosition\":11,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":11,\"nbrPlacementsScanned\":12,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":1054} --><!-- Zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"after\",\"adPosition\":12,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":12,\"nbrPlacementsScanned\":12,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":0} --><br \/>\nThis should get you started in understanding the Hosts file and how it can help protect your computer. Under the right circumstances, you can use it to block sites that you don&#8217;t want a PC to be able to access.<br \/>\n<!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":12,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":12,\"nbrPlacementsScanned\":13,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":214} --><\/p>\n<p><!-- No repeatable ad for zone: character count repeatable. --><!-- Repeatable debug data: {\"injection\":\"none\",\"adPosition\":12,\"startingPoint\":1,\"skipEvery\":null,\"nbrPlacementFilledEachSkip\":12,\"nbrPlacementsScanned\":13,\"ruleCount\":900,\"degradationStartingPoint\":2,\"actualCount\":215} --><\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.howtogeek.com\/27350\/beginner-geek-how-to-edit-your-hosts-file\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Key Takeaways On Windows, launch Notepad (or another text editor) as Administrator. Open the hosts file, which is located under C:\\Windows\\System32\\drivers\\etc. On Mac and Linux, edit the \/etc\/hosts file using your text editor as choice \u2014 be sure to launch the editor with sudo. Occasionally you may need to edit the hosts file on your&#8230;<\/p>\n","protected":false},"author":1,"featured_media":590638,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/static1.howtogeekimages.com\/wordpress\/wp-content\/uploads\/2023\/09\/52845868601_0615850e03_o-1.jpg","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-590637","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/590637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=590637"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/590637\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/590638"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=590637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=590637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=590637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}