Flushing the local DNS cache
Aug 24 2010 · Networking
If your messing around with DNS records and finding that names are are not resolving to their new locations (this happened to me today), flushing the local DNS resolver cache may help (if not, you probably have to wait for DNS propagation or you configured something incorrectly). I only needed to do this on a Windows server, but I decided to dig a bit deeper to find out how to do this on other systems as well.
On Linux it’s a bit more difficult and not as simple as ifconfig /flushdns. You can try to restart the nscd daemon (note the path may be different depending on the distro):
However, nscd may not be installed on some distros (e.g. Ubuntu) and applications (e.g. Firefox) may keep their own cache. So you’ll need to restart the application in such cases. If your desperate, you can also restart the entire networking subsystem:
On OS X, Leopard and higher
On OS X, Tiger and lower