DNS caching
Interesting issue today whilst I was migrating some websites to a new host. Even after updating the DNS records with our domain name registrar we were still viewing old content, after much head scratching and blaming the internet connection we concluded there was some sort of caching going on. Didn’t make sense to me initially, but after some relaxing tunes courtesy of Linkin Park and a coffee it dawned on me. DNS caching. In a nutshell Internet hosts, even your PC use our good friend the DNS server to resolve domains to webservers. To find out where the actual stuff is
(Lame re-enactment)
PC A: where's melbournechapter.net DNS A: anybody know where melbournechapter.net lives DNS B: its over here... 123.45.67.89 DNS A: cheers bud. Hey PC I just heard its over here .. 123.45.67.89 PC A: Thanks. PC B: where's melbournechapter.net DNS A: Oh I know this one! It's over here 123.45.67.89 [ later that day melbournechapter.net moves to a new address]
Pretty mundane work I must say, and DNS A, our local DNS thinks so too. So rather than asking DNS B, our authorative DNS the location again it just sends PC B the address it previously got i.e. it uses its cached record. Meanwhile melbournechapter.net moved address so PC B gets the old location. Now usually this isn’t too much of a problem since a local DNS only remembers request for only a certain period known as TTL (Time To Live), so eventally DNS A will get the updated address. However, if your demonstrating something to a client you can get some rather strange results. Trust me when I say its pretty frustrating explaining you’ve updated something and all they can see through their browser is old content! Now to prevent this you can edit your registry or your clients registry for that matter but I dont recommend it! Instead just flush the DNS using ipconfig in Command Prompt (In XP Start > Run > Enter “cmd”):
C:Documents and Settingsrlee> iponfig /flushdns
And don’t forget to close and re-open the browser!





