
{"id":2862,"date":"2016-05-01T22:03:23","date_gmt":"2016-05-01T21:03:23","guid":{"rendered":"https:\/\/www.trucnet.com\/?p=2862"},"modified":"2016-05-01T22:03:23","modified_gmt":"2016-05-01T21:03:23","slug":"le-fichier-host-de-windows","status":"publish","type":"post","link":"https:\/\/www.trucnet.com\/en\/the-windows-hosts-file\/","title":{"rendered":"The Windows hosts file"},"content":{"rendered":"<p><strong>What is the purpose of the hosts file?<\/strong><br \/>\nThe hosts file (present by default in unix systems under \/etc\/hosts) is the first step in translating a fully qualified domain name (FQDN) into an IP address.<br \/>\nThis is the file that is queried first before making a DNS request to the web&#039;s address servers.<br \/>\nTherefore, for each name configured in this file with an IP address after a space, a connection will be opened to the indicated IP address.<br \/>\nIt therefore functions like a telephone directory.<br \/>\nIf this address is 127.0.0.1 (myself) the connection will try to make itself on localhost, i.e., the own machine.<br \/>\nIf a server exists on the machine itself, the internal server will be accessed; if the server does not exist, nowhere will be accessed.<br \/>\nThe IP address of localhost is written as 127.0.0.1 in IPv4 and ::1 in IPv6.<br \/>\nOn machines with IPv6 enabled, both can therefore be written.<br \/>\nThe use explained below is therefore a misuse of its function in order to block access to certain sites.<\/p>\n<p><strong>Why modify the hosts file?<\/strong><br \/>\nThe hosts file is consulted every time a website is accessed, much like an address book. If the site is listed in the hosts file, access is blocked if the address is 127.0.0.1. However, if it is not found in the file, your internet service provider (ISP) will connect you to the IP address of the requested site.<\/p>\n<p>By modifying the hosts file, you will be able to:<br \/>\nblock access to certain sites, speed up access to sites you prefer and whose IP address you know, bypass the blocking of access to security sites caused by certain harmful programs.<\/p>\n<p><strong>How do I edit the hosts file?<\/strong><br \/>\nWhere is the original hosts file located? The original hosts file is located here:<br \/>\nC:\\WINDOWS\\system32\\drivers\\etc\\hosts<\/p>\n<p><strong>What does it contain? It should contain this if it is intact:<\/strong><\/p>\n<pre>Copyright (c) 1993-1999 Microsoft Corp. This is a sample HOSTS file used by Microsoft TCP\/IP for Windows. This file contains the mappings of IP addresses to hostnames. Each entry must be on a separate line. The IP address must be placed in the first column, followed by the corresponding hostname. The IP address and hostname must be separated by at least one space. Additionally, comments (such as this one) may be inserted on separate lines or after the computer name. They are indicated by the symbol &#039;#&#039;. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # client host x 127.0.0.1 localhost<\/pre>\n<p>If you have the same text as above, it&#039;s clean, but it&#039;s not very useful!<\/p>\n<p><strong>Modification method<\/strong><br \/>\nThe first thing to do is open your preferred text editor, such as Notepad, in administrator mode. This is done by navigating to the Start menu -&gt; right-clicking on WordPad, for example -&gt; Run as administrator.<\/p>\n<p><a  href=\"https:\/\/www.trucnet.com\/wp-content\/uploads\/2016\/05\/methode-de-modification-fichier-hosts.png\" data-rel=\"lightbox-gallery-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2865\" src=\"https:\/\/www.trucnet.com\/wp-content\/uploads\/2016\/05\/methode-de-modification-fichier-hosts-300x218.png\" alt=\"method-of-modification-hosts-file\" width=\"300\" height=\"218\" srcset=\"https:\/\/www.trucnet.com\/wp-content\/uploads\/2016\/05\/methode-de-modification-fichier-hosts-300x218.png 300w, https:\/\/www.trucnet.com\/wp-content\/uploads\/2016\/05\/methode-de-modification-fichier-hosts.png 400w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<br \/>\nOnce the text editor is open, go to File -&gt; Open and navigate to the hosts file (C:\\WINDOWS\\system32\\drivers\\etc\\hosts).<\/p>\n<p>Now we&#039;re going to do something very useful: add sites to block.<br \/>\nSelect this: (note the space of one tab (TAB) between 127.0.0.1 and gromozon.com)<\/p>\n<pre>127.0.0.1 gromozon.com 127.0.0.1 xearl.com 127.0.0.1 td8eau9td.com 127.0.0.1 mioctad.com 127.0.0.1 mufxggfi.com 127.0.0.1 uv97vqm3.com 127.0.0.1 coeds.com* 127.0.0.1 lah3bum9.com* 127.0.0.1 cvoesdjd.com*<\/pre>\n<p>Once finished, your file should look like this:<\/p>\n<p><a  href=\"https:\/\/www.trucnet.com\/wp-content\/uploads\/2016\/05\/une-fois-termine-votre-fichier-hosts-doit-etre-comme-ceci.png\" data-rel=\"lightbox-gallery-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2868\" src=\"https:\/\/www.trucnet.com\/wp-content\/uploads\/2016\/05\/une-fois-termine-votre-fichier-hosts-doit-etre-comme-ceci-300x218.png\" alt=\"Once finished, your hosts file should look like this.\" width=\"300\" height=\"218\" srcset=\"https:\/\/www.trucnet.com\/wp-content\/uploads\/2016\/05\/une-fois-termine-votre-fichier-hosts-doit-etre-comme-ceci-300x218.png 300w, https:\/\/www.trucnet.com\/wp-content\/uploads\/2016\/05\/une-fois-termine-votre-fichier-hosts-doit-etre-comme-ceci.png 400w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Obviously, you can add as many addresses as you want.<br \/>\nThere are also ready-made lists of Hosts\u2026<br \/>\nBe aware, however, that if your hosts file becomes large, it may cause a problem with the Windows ClientDNS service, which would be redundant.<\/p>\n<p>(which puts an svchost process at 99% in your Task Manager) so, be careful\u2026<\/p>\n<p>You simply need to disable this service if you want to use a large hosts file:<br \/>\nStart \/ Run \/ type services.msc \/ find ClientDNS in the right-hand column \/ set it to &quot;Disabled&quot;<br \/>\nExample with MVPS HOSTS:<br \/>\nDownload this: <a href=\"http:\/\/winhelp2002.mvps.org\/hosts.zip\" target=\"_blank\">http:\/\/winhelp2002.mvps.org\/hosts.zip<\/a><br \/>\nUnzip the archive and place the HOSTS file in the following folder: C:\\Windows\\system32\\drivers\\etc<\/p>\n<p>Some addresses should be blocked in your firewall: (IP Ranges)<br \/>\nTo summarize, if you happen to come across one of these addresses on the Net, right-hand columns, the computer will redirect to 127.0.0.1 (your computer&#039;s IP address).<br \/>\nTry pasting the line 127.0.0.1 into your Explorer to see the result!<\/p>\n<pre class=\"code\" data-mode=\"php\">195.225.176.0 - 195.225.179.255                 \r\n85.255.112.0 - 85.255.127.255                 \r\n66.230.175.0 - 66.230.175.255<\/pre>","protected":false},"excerpt":{"rendered":"<p>A quoi sert le fichier hosts ? Le fichiers hosts (pr\u00e9sent \u00e0 la base dans les syst\u00e8mes unix sous \/etc\/hosts) est la premi\u00e8re \u00e9tape pour la transposition d&rsquo;un nom de machine fqdn en adresse ip. C&rsquo;est ce fichier qui est interrog\u00e9 en premier avant de faire une requ\u00eate dns sur les serveurs d&rsquo;adresse du web. [&hellip;]<\/p>","protected":false},"author":1,"featured_media":2866,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"no","_lmt_disable":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[25],"tags":[461,80,1580,1581,679,1582,1341,1583,20],"class_list":["post-2862","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-astuces-infos","tag-astuce","tag-bloque","tag-fichier-host","tag-host","tag-ip","tag-isertion","tag-modification","tag-serveurs","tag-windows"],"aioseo_notices":[],"modified_by":"Auteur","_links":{"self":[{"href":"https:\/\/www.trucnet.com\/en\/wp-json\/wp\/v2\/posts\/2862","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.trucnet.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trucnet.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trucnet.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trucnet.com\/en\/wp-json\/wp\/v2\/comments?post=2862"}],"version-history":[{"count":0,"href":"https:\/\/www.trucnet.com\/en\/wp-json\/wp\/v2\/posts\/2862\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.trucnet.com\/en\/wp-json\/wp\/v2\/media\/2866"}],"wp:attachment":[{"href":"https:\/\/www.trucnet.com\/en\/wp-json\/wp\/v2\/media?parent=2862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trucnet.com\/en\/wp-json\/wp\/v2\/categories?post=2862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trucnet.com\/en\/wp-json\/wp\/v2\/tags?post=2862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}