我需要在hosts文件中添加自定义IP主机行:
c:\windows\system32\drivers\etc\hosts
我尝试添加这个:
199.229.249.151 models.db
当我保存文件并尝试ping主机时,浏览器找不到它。我尝试使用命令行将只读添加到hosts文件 - 结果相同。我尝试刷新DNS缓存,但没有任何变化。
我忘了什么?
答案 0 :(得分:10)
我遇到了同样的问题,在检查了很多东西之后,问题最终成了行结尾,我将行结尾更改为Windows格式并且它有效。
答案 1 :(得分:4)
答案 2 :(得分:2)
尝试ping localhost。
如果它有效,那么ip或你的输入有问题。如果没有,则hosts文件不好。注意它去哪里。它可能会尝试ipv6。这仍然意味着主机文件已损坏。
从中删除所有内容,只留下您的条目或本地主机。只有一行,没有别的!甚至没有换行。只需将它藏在某处,直到问题得到解决。
如果它有效,那么就有一个破坏事物的条目。尝试将行结尾转换为Windows格式,可能会有所帮助。通常它的白色空间会与事物混淆,因为它很难被注意到。
答案 3 :(得分:2)
我曾经遇到此问题,问题是Windows忽略了主机文件,并通过以下方式修复了该文件:
- 将主机文件从
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.issweb.fiorilli.com.br/" xmlns:xd="http://www.w3.org/2000/09/xmldsig#"> <soapenv:Header /> <soapenv:Body> <ws:gerarNfse> <GerarNfseEnvio xmlns="http://www.abrasf.org.br/nfse.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Rps> <InfDeclaracaoPrestacaoServico> <Rps> <IdentificacaoRps> <Numero>1</Numero> <Serie>999</Serie> <Tipo>1</Tipo> </IdentificacaoRps> <DataEmissao>2018-11-27</DataEmissao> <Status>1</Status> </Rps> <Competencia>2018-11-27</Competencia> <Servico> <Valores> <ValorServicos>209000</ValorServicos> </Valores> <IssRetido>2</IssRetido> <ItemListaServico>01.05</ItemListaServico> <Discriminacao>Discriminacao teste blablabla</Discriminacao> <CodigoMunicipio>3504800</CodigoMunicipio> <ExigibilidadeISS>1</ExigibilidadeISS> </Servico> <Prestador> <CpfCnpj> <Cnpj>01001001000113</Cnpj> </CpfCnpj> <InscricaoMunicipal>15000</InscricaoMunicipal> </Prestador> <Tomador> <IdentificacaoTomador> <CpfCnpj> <Cpf>35770121025</Cpf> </CpfCnpj> </IdentificacaoTomador> <RazaoSocial>DADOS TOMADOR</RazaoSocial> <Endereco> <Endereco>RUA TOMADOR</Endereco> <Numero>23</Numero> <Complemento>COMPLEMENTO TOMADOR</Complemento> <Bairro>BAIRRO TOMADOR</Bairro> <Uf>MG</Uf> <CodigoPais>1058</CodigoPais> <Cep>37170000</Cep> </Endereco> <Contato> <Telefone>(35) 38511836</Telefone> <Email>mariana@live.com</Email> </Contato> </Tomador> <OptanteSimplesNacional>2</OptanteSimplesNacional> <IncentivoFiscal>2</IncentivoFiscal> </InfDeclaracaoPrestacaoServico> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> <SignedInfo> <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /> <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> <Reference URI=""> <Transforms> <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /> <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /> </Transforms> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> <DigestValue>s8BhRVqeQKRh4H6nlHJEQudBJ+w=</DigestValue> </Reference> </SignedInfo> <SignatureValue>IxrI+sqg6XEg7Dl0utAlJviTKT5fTu1NTErntiSjb61B5q/nP68r4wZ12vqXW5/G92pr+ZUZfLVwnG8vrFx8tsX/eObfpwOxZRfissuuOVQrLmFmHOvLs08VpbkffQpvLIhkpDzLV3pcIPsjgo7UQu+99mB4K+iEZYnfedgmJ8s/6EIcJLoWs9TvJHfpANgbEXSndi0nua1uDr9/FN4oO0jD2lRX+JHp7XJNjcjzS1N/kFG+JSyq0R017Ul0F/qR7dcOsBlFvb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jg3MjAzMDAwMTkwoBcGBWBMAQMHoA4EDDAwMDAwMDAwMDAwMDANBgkqhkiG9w0BAQsFAAOCAgEAu3q0uC0WksHrcbk+jVnnmbveNO/Ttqk5JT91lJeA8OKzNWuFIowoVxsKTBHn1qRsimss5xObsDXtKd7zUZkEvqdE1mFI3HWkm45bmc7ljGCdnQ7C4NhDVr08nMCRlxr+r+k/7+mlhdgdgmVjbxZwzbFATO4PKO3qYij7HMw/lzwWOsnmgNG6EAhTZtapT+G5OnA80ENmRYVeg/a0uzWrPmOKzMPnTG6FM86gZZ53Ge84KCtLad4MmWzMtlHsGz5KgxMauWL/iGMZ8I5YRzTzRmGUuRxWYijKMn5nIZpjJ/FrDzryJAyvaErbMmayhKx6+1AwLsEe+K7L2TsFIfhPVUvXgeSs2yg8of5wUeDTn1KYVEcBp4XCukgqiicHkgxfcfnf4lPwSHM09576i4mEn4u4sAoeiBuTgfRkuhsYu8cLGfWGArr46pc4++FglRBzOAHDAKziW35cVfpi8ycm2F0JCa4QDfNbIlGK08U4O25VvJ5/W8hCLeTHCWtHYtYfixPh/LLT1PB5up8dhxpmgIUJQtW2OT3tRfEzxoJ64uALpSNVYZ5dY6OnlrO2qW0bZU+Wdc5uzcDH7YeCoviZ/SOCcRW/9kq5MAGVbpTsN3u9lzqCJjSWavGwP+it9YRo8OpLxtgoISCe08zd9ckSJxJtUyRaQkZ1o1INKh7dotQ=</X509Certificate> </X509Data> </KeyInfo> </Signature> </Rps> </GerarNfseEnvio> <username>01001001000113</username> <password>123456</password> </ws:gerarNfse> </soapenv:Body> </soapenv:Envelope>
复制到类似Desktop的位置- 在此处删除主机文件
- 将复制的主机文件复制回
C:\Windows\System32\drivers\etc
我不知道为什么,但是它是固定的。
答案 4 :(得分:1)
打开记事本&gt;启动打开记事本&gt;以管理员身份打开。
将其保存在ANSI主机文件的某个位置(不是.txt扩展名,选择所有文件并将其命名为主机)
复制所有主机文件条目并保存。
最后复制在所需位置复制的hosts文件,例如:C:\ tempfolder \ hosts到c:windows \ system32 \ drivers \ etc文件夹。
答案 5 :(得分:0)
我遇到同样的问题,发现我的主机是unicode,将其更改为ANSI后,问题就解决了