{"id":5944,"date":"2018-07-31T10:23:10","date_gmt":"2018-07-31T13:23:10","guid":{"rendered":"http:\/\/wiki3.locaweb.com.br\/?post_type=ht_kb&#038;p=5944"},"modified":"2020-05-08T14:41:01","modified_gmt":"2020-05-08T17:41:01","slug":"configurar-o-arquivo-etc-host","status":"publish","type":"ht_kb","link":"https:\/\/www.locaweb.com.br\/ajuda\/wiki\/configurar-o-arquivo-etc-host\/","title":{"rendered":"Configurar o arquivo etc\/host"},"content":{"rendered":"<p>O arquivo \u201chosts\u201d \u00e9 utilizado pelos sistemas operacionais para relacionar hostnames e endere\u00e7os IP.<\/p>\n<p>Por exemplo o site da sua empresa tem um IP 10.0.0.2, voc\u00ea pode fazer a altera\u00e7\u00e3o no arquivo \u201chosts\u201d do seu computador para qualquer endere\u00e7o que digitarem na internet dentro da sua rede ou computador ser redirecionado para o site da sua empresa, porque o que define o acesso a p\u00e1gina \u00e9 o endere\u00e7o IP configurado nesse arquivo.<\/p>\n<p>Pensando nesse problema segue uma sugest\u00e3o da altera\u00e7\u00e3o que \u00e9 necess\u00e1rio fazer.<\/p>\n    \t\t<div class=\"hts-messages hts-messages--alert   hts-messages--withicon \"   >\r\n    \t\t\t    \t\t\t    \t\t\t\t<p>\r\n    \t\t\t\t\tCuidado com a inclus\u00e3o deste tipo de configura\u00e7\u00e3o, pode atrapalhar a resolu\u00e7\u00e3o de DNS em alguns casos. Ao finalizar os testes exclua a configura\u00e7\u00e3o realizada.    \t\t\t\t<\/p>\r\n    \t\t\t    \t\t\t\r\n    \t\t<\/div><!-- \/.ht-shortcodes-messages -->\r\n    \t\t\n    \t\t<div class=\"hts-toggle  \"  >\r\n    \t\t\t<div class=\"hts-toggle__title\">Windows<\/div>\r\n    \t\t\t<div class=\"hts-toggle__content\">\r\n    \t\t\t\t<div class=\"hts-toggle__contentwrap\">\r\n    \t\t\t\t\t<\/p>\n<ul>\n<li>Abra a pesquisa do windows e cole o seguinte comando:<\/li>\n<\/ul>\n<pre>c:\\windows\\system32\\drivers\\etc\\hosts<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5947\" src=\"https:\/\/www.locaweb.com.br\/ajuda\/wp-content\/uploads\/2018\/07\/Configurar-o-arquivo-etc-host-01.png\" alt=\"\" width=\"411\" height=\"476\" srcset=\"https:\/\/www.locaweb.com.br\/ajuda\/wp-content\/uploads\/2018\/07\/Configurar-o-arquivo-etc-host-01.png 411w, https:\/\/www.locaweb.com.br\/ajuda\/wp-content\/uploads\/2018\/07\/Configurar-o-arquivo-etc-host-01-259x300.png 259w, https:\/\/www.locaweb.com.br\/ajuda\/wp-content\/uploads\/2018\/07\/Configurar-o-arquivo-etc-host-01-43x50.png 43w, https:\/\/www.locaweb.com.br\/ajuda\/wp-content\/uploads\/2018\/07\/Configurar-o-arquivo-etc-host-01-52x60.png 52w, https:\/\/www.locaweb.com.br\/ajuda\/wp-content\/uploads\/2018\/07\/Configurar-o-arquivo-etc-host-01-86x100.png 86w\" sizes=\"auto, (max-width: 411px) 100vw, 411px\" \/><\/p>\n<ul>\n<li>Escolha abrir com <strong>bloco de notas<\/strong>.<\/li>\n<li>Informe os <strong>IP&#8217;s<\/strong> e <strong>dom\u00ednios<\/strong>, utilizado o mesmo padr\u00e3o do arquivo.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5948\" src=\"https:\/\/www.locaweb.com.br\/ajuda\/wp-content\/uploads\/2018\/07\/Configurar-o-arquivo-etc-host-02.png\" alt=\"\" width=\"670\" height=\"405\" srcset=\"https:\/\/www.locaweb.com.br\/ajuda\/wp-content\/uploads\/2018\/07\/Configurar-o-arquivo-etc-host-02.png 670w, https:\/\/www.locaweb.com.br\/ajuda\/wp-content\/uploads\/2018\/07\/Configurar-o-arquivo-etc-host-02-300x181.png 300w, https:\/\/www.locaweb.com.br\/ajuda\/wp-content\/uploads\/2018\/07\/Configurar-o-arquivo-etc-host-02-50x30.png 50w, https:\/\/www.locaweb.com.br\/ajuda\/wp-content\/uploads\/2018\/07\/Configurar-o-arquivo-etc-host-02-60x36.png 60w, https:\/\/www.locaweb.com.br\/ajuda\/wp-content\/uploads\/2018\/07\/Configurar-o-arquivo-etc-host-02-100x60.png 100w\" sizes=\"auto, (max-width: 670px) 100vw, 670px\" \/><\/p>\n<p>Salve o arquivo e aguarde a propaga\u00e7\u00e3o dentro da sua rede.<\/p>\n<p>\n    \t\t\t\t<\/div>\r\n    \t\t\t<\/div><!-- \/ht-toggle-content -->\r\n    \t\t<\/div>\r\n    \t\t\n    \t\t<div class=\"hts-toggle  \"  >\r\n    \t\t\t<div class=\"hts-toggle__title\">Linux<\/div>\r\n    \t\t\t<div class=\"hts-toggle__content\">\r\n    \t\t\t\t<div class=\"hts-toggle__contentwrap\">\r\n    \t\t\t\t\t<\/p>\n<ul>\n<li>Abra o terminal do linux e digite o seguinte comando:<\/li>\n<\/ul>\n<pre>vi \/etc\/hosts<\/pre>\n<ul>\n<li>O uso do \u201cvi\u201d \u00e9 facultativo. Voc\u00ea pode substitu\u00ed-lo por outro editor de sua prefer\u00eancia que esteja instalado no servidor, bastando alterar a forma de acesso.<\/li>\n<li>Essa \u00e9 a tela do arquivo <strong>\/etc\/hosts<\/strong><\/li>\n<li>Repare que o coment\u00e1rio (#) antes do endere\u00e7o de IP impede que voc\u00ea consiga acessar o host de dentro do servidor.<\/li>\n<li>Para fazer a altera\u00e7\u00e3o para o dom\u00ednio acessar dentro do servidor basta tirar o coment\u00e1rio do endere\u00e7o do servidor como abaixo:<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5953\" src=\"https:\/\/www.locaweb.com.br\/ajuda\/wp-content\/uploads\/2018\/07\/Configurar-o-arquivo-etc-host-03.png\" alt=\"\" width=\"566\" height=\"112\" srcset=\"https:\/\/www.locaweb.com.br\/ajuda\/wp-content\/uploads\/2018\/07\/Configurar-o-arquivo-etc-host-03.png 566w, https:\/\/www.locaweb.com.br\/ajuda\/wp-content\/uploads\/2018\/07\/Configurar-o-arquivo-etc-host-03-300x59.png 300w, https:\/\/www.locaweb.com.br\/ajuda\/wp-content\/uploads\/2018\/07\/Configurar-o-arquivo-etc-host-03-50x10.png 50w, https:\/\/www.locaweb.com.br\/ajuda\/wp-content\/uploads\/2018\/07\/Configurar-o-arquivo-etc-host-03-60x12.png 60w, https:\/\/www.locaweb.com.br\/ajuda\/wp-content\/uploads\/2018\/07\/Configurar-o-arquivo-etc-host-03-100x20.png 100w\" sizes=\"auto, (max-width: 566px) 100vw, 566px\" \/><\/p>\n<ul>\n<li>Para salvar e sair do editor, pressione Esc e digite <strong>:wq<\/strong><\/li>\n<\/ul>\n<p>\n    \t\t\t\t<\/div>\r\n    \t\t\t<\/div><!-- \/ht-toggle-content -->\r\n    \t\t<\/div>\r\n    \t\t\n<p>Conhe\u00e7a nosso servi\u00e7o de <a href=\"https:\/\/www.locaweb.com.br\/cloud\/cloud-hosting\/\" target=\"_blank\" rel=\"noopener noreferrer\">Cloud Hosting<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>O arquivo \u201chosts\u201d \u00e9 utilizado pelos sistemas operacionais para relacionar hostnames e endere\u00e7os IP. Por exemplo o site da sua empresa tem um IP 10.0.0.2, voc\u00ea pode fazer a altera\u00e7\u00e3o no arquivo \u201chosts\u201d do seu computador para qualquer endere\u00e7o que digitarem na internet dentro da sua rede ou computador ser&#8230;<\/p>\n","protected":false},"author":232,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[],"ht-kb-tag":[],"class_list":["post-5944","ht_kb","type-ht_kb","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/ht-kb\/5944","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/users\/232"}],"replies":[{"embeddable":true,"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/comments?post=5944"}],"version-history":[{"count":4,"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/ht-kb\/5944\/revisions"}],"predecessor-version":[{"id":21830,"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/ht-kb\/5944\/revisions\/21830"}],"wp:attachment":[{"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/media?parent=5944"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/ht-kb-category?post=5944"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/ht-kb-tag?post=5944"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}