Testing websites can be a huge pain if the DNS refuses to update after an update – I’m looking at you Safari!
As I’ve done a thousand times before I just updated the DNS for one of my client’s domain names and waited, and waited, and waited some more for Safari to display the new server. No amount of clearing the cache in Safari or refreshing would show the new server. After 30 minutes I finally got sick of waiting and did a bit of research on how to fix this issue. Thankfully it’s a super easy solution.
Just open Terminal, enter the following command that corresponds to your version of Mac OS X and hit enter – that’s it! Serious warning though – don’t even consider retyping the command, just copy and paste it. And be careful as this technique involves using Terminal and you can seriously screw things up if you’re not cautious.
OS X Yosemite and later
OS X Mavericks, Mountain Lion, and Lion
Mac OS X Snow Leopard
This support document from Apple explains in more detail how to reset Mac OS X’s DNS cache.
For some reason Chrome was able to see the new server even before I flushed the DNS cache so I’m assuming that it uses it’s own caching system. I don’t use Chrome as my day-to-day browser, and it worked properly, so I don’t really care why it works, it just does and that’s a good thing. I still prefer Safari and at least now with this quick tip I can see the proper DNS settings without waiting for hours!