Welcome to WebmasterWorld Guest from 188.8.131.52
Forum Moderators: phranque
What I would like to do is develop locally as www.somedomain.com, run a script to change my PC's settings, upload files, then check on the WWW to make sure everything is ok. Currently I have a script that 1) switches the default hosts file with the one I made with my site entries (or vice versa) -and- 2) flushes the local DNS cache.
So, I boot up the PC and my hosts file is default. I type www.somedomain.com into my browser and online content from the web is displayed. Now here's the problem. I run my switch script which swaps hosts files to the one having an entry for www.somedomain.com and flushes the local DNS cache. If I ping www.somedomain.com it resolves locally. if I ipconfig /displaydns it is listed as having a local IP address... problem is, it takes almost 5 minutes for any browser to start displaying local content.
I have tried clearing browser cache.
I have tried hard refresh.
I have tried stopping/starting Apache.
I have tried stopping/starting local DNS service.
I have tried killing local DNS service altogether.
I have tried altering the registry to locally cache DNS entries for only a few seconds.
If I wait a few minutes, www.somedomain.com starts displaying locally served content like it should. SO... I run my switch script again and the reverse happens. Ping and displaydns show outside-world IP's but the browsers take about 5 minutes to reflect changes.
Bottom line ::: I hope to find a way for the change to be instantaneous in my web browsers.