homepage Welcome to WebmasterWorld Guest from 54.237.151.188
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque

Webmaster General Forum

    
Windows DNS Cache Question.
adephue

5+ Year Member



 
Msg#: 3541194 posted 7:02 pm on Jan 5, 2008 (gmt 0)

I am a web developer by trade and I am looking to streamline my local developing experience in the following way. As a precursor to my question, I have Apache and MySQL running locally on my PC. Currently, if I pull down a new client's website for development (let's say www.somedomain.com); I create an Apache virtualhost for dev.somedomain.com AND a hosts file entry to resolve dev.somedomain.com to a local IP address. Frequently I find hard-coded absolute URL's which requires me to find/replace, make site changes, find replace again, then upload.

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.

Any ideas?

 

daveVk

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 3541194 posted 11:48 pm on Jan 5, 2008 (gmt 0)

Think its the browser caching the dns (mozzila at least does), try opening new browser window/tab or restarting browser.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved