none
[Help]Hosts changing to take effect without restarting IE??

    Question

  • I'm a web site developer. Frequently I have to test some web pages in different enverionments: two web page has the same url address, but on different physical machines.

    I switch the enverionment by change the hosts file in the C:\WINDOWS\system32\drivers\etc directory. But only when I restart IE can this change take effect. I guess this is because the IE has cached the hosts file's content. So it won't read the file again when I open a new web page.

     

    Now I have two questions:

    1. Is there an option in IE that can disable its internal hosts file cache, so that every time it open a new url, it reload the host configuraion from local hosts file?

    2. Or is there an API interface which I can use to refresh the cache?

     

    I'm not a native English speaker so I don't know if I have clearly stated my problem.

    Any help would be greatly appreciated

    Wednesday, July 23, 2008 3:23 PM

All replies

  • Try pressing CTRL+F5 to refresh after you switch the hosts file.
    Wednesday, July 23, 2008 5:22 PM
  • Thanks for reply!

    Seems not work, I still need restart to take effect :-(

    Wednesday, July 23, 2008 11:54 PM
  • Sorry.  That was my best guess.

     

    Thursday, July 24, 2008 7:14 PM
  • Hello, anyone have a solution for this problem ?

     I need a solution in that day.

    Thanks you
    Monday, November 23, 2009 9:31 AM
  • You could try
    ipconfig /flushdns
    after you change the host file to flush the dns cache, but I suspect you're just going to have to restart IE if that doesn't work.  There is no magic switch for this.
    Tuesday, November 24, 2009 5:23 PM
  • Hi, I've the same pb...

    no more solution today ?

    Thursday, June 10, 2010 12:20 PM
  • I know this is an old question, but in case anybody wonders: try holding down CTRL while clicking the reload button on the toolbar.

     

    Friday, December 17, 2010 10:46 PM
  • You could try
    ipconfig /flushdns
    after you change the host file to flush the dns cache, but I suspect you're just going to have to restart IE if that doesn't work. There is no magic switch for this.

    Thanks for your explanation! Now I got it.
    Thursday, January 20, 2011 1:28 AM