Clearing/Editing Internet explorer DNS cache
I am using internet IE 7, IE 8
My application in running in dns fail over environment with primary and back up server. As the primary server is down, failover changes to the secondary server after 2 - 3 minutes.
But the problem is, 开发者_StackOverflow社区the current opened page in IE is still sending requests to the primary server due to dns caching, which stores the IP of the primary server for default 30 minutes) and hanged.
This problem can be solved if we can clear or edit the dns cache with C# ASP.Net coding.
Thanks in advance for replying.
You cannot access a client machine's DNS Cache from your ASP.NET server or anything in the browser. It would be a huge security hole to either of those environments to do so.
The better approach if you're looking for DNS failover is to talk to your network administrator. Ask him/her to set the TTL for your DNS records to a number smaller than your failover time. This will increase the frequency with which the client machines refresh their caches (for your site only) and shorten their downtime in the event of a failover.
The negligible drawback is that it can increase (ever so slightly) their wait time for the site because they have to do DNS requests more often.
There is an undocumented api called DnsFlushResolverCache in dnsapi.dll, see this link for an example for how to use it from C# (not ASP.NET) .
I have the similar issue from JAva applet. JVM has bug which doesn't honor the System property to disable DNS caching. Any workarounds? Changing the java.security file works. But I am looking for a better solution.
精彩评论