Ever done a site migration and not been sure which server you were seeing in the browser? Here are a few steps you can do to verify:

We’ll assume you’re changing the site at example.com is currently at 10.0.0.10 and you’re moving it to 172.16.0.11. First let’s check that the DNS changes you made are available:

$ nslookup example.com

should return something like:

server:		8.8.4.4
Address:	8.8.4.4#53

Non-authoritative answer:
Name:	example.com
Address: 172.16.0.11

So here we see the new IP address. But we’re still seeing the old address in the browser. Well, let’s clear the OS level DNS cache:

For OSX:

dscacheutil -flushcache

For Windows:

ipconfig /flushdns

For Linux - it depends. Many systems don’t cache DNS records. Others do so via ncsd. You’ll need to check your distribution / installation to find the correct way.

So now we’ve changed the DNS successfully, flushed our OS level cache (or we aren’t using a cache). Surely the new site will show up now. Wait… what?? It doesn’t?!? What could be going on? Oh… the browser. Let’s clear the browser cache. Still no?

Well, if you’re using Chrome, try going to chrome://net-internals/#dns and hitting the Clear host cache button.

If you’re using Firefox put about:config in the address bar and hit enter. In the search bar type network.dns and the entries will be filtered down. Find the entry that says network.dnsCacheExpiration and make note of the value (3600). Change the value to 0. Now go back and change it to the original value.

As far as I can tell, Safari uses the OS level DNS cache. I haven’t used Opera or IE for a while so I don’t know about those.