dongyao2022
dongyao2022
2014-01-21 16:47
浏览 31
已采纳

为什么浏览器在hosts文件中找不到url?

in my hosts file:

127.0.0.1   test1.ru
127.0.0.1   www.test1.ru

My broswers(google chrome, firefox) don't find this URL, can't access to this page, after editing the hosts file I've realoaded the browsers(also cleared all the cache), but still no luck why this can be happening?

I'am using denwer... the localhost is loaded succesfully, but sites like http://test1.ru - no luck

any ideas?

图片转代码服务由CSDN问答提供 功能建议

我的主机文件中的

  127.0.0.1 test1。  ru 
127.0.0.1 www.test1.ru 
   
 
 

我的broswers(google chrome,firefox)找不到这个URL,无法访问此 页面,在编辑了主机文件之后我已经真实地编写了浏览器(也清除了所有缓存),但仍然没有运气为什么会发生这种情况?

我正在使用denwer ... localhost已成功加载,但 http://test1.ru 等网站 - 没有运气

任何想法?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • drmqzb5063
    drmqzb5063 2014-01-21 16:50
    已采纳

    Try clearing your DNS cache. Close all browsers. From the command prompt (as administrator), type:

    ipconfig /flushdns
    

    This will flush out any cached DNS queries you have in your browsers and operating system.

    点赞 评论
  • dongshuo8756
    dongshuo8756 2014-01-21 16:51

    Maybe I am misunderstanding the question, but that's the whole idea of that entry.

    Setting it to 127.0.0.1 makes that domain point to your local computer, so the browser tries to load the site from your local computer as soon as you try to access test1.ru.

    点赞 评论
  • duanbi3385
    duanbi3385 2014-01-21 16:56

    You need to change the approach.

    Hosts file is for pointing DOMAINS(stackoverflow.com, xyz.com, abc.com) to SERVERS ADDRESS just like a DNS SERVER would do so.

    test1.ru 127.0.0.1

    OR

    test1.ru $YOURSERVER$

    NOTE: To get your server's IP you can PING it and you'll know what's your server's IP Address.

    Any more questions? Happy to help!

    点赞 评论

相关推荐