dongyao2022
dongyao2022
2014-01-21 16:47

为什么浏览器在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?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

3条回答

  • drmqzb5063 drmqzb5063 7年前

    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.

    点赞 评论 复制链接分享
  • duanbi3385 duanbi3385 7年前

    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!

    点赞 评论 复制链接分享
  • dongshuo8756 dongshuo8756 7年前

    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.

    点赞 评论 复制链接分享

相关推荐