How do I flush the DNS cache on Win, Mac, and Linux computers?
Mac (OS X 10.5)
If you are using nscd:
In Windows you can turn off client-side DNS caching using this command:
It stops the DNS Caching service. It will restart with the next rebooting.
This is what Google replied:
To flush DNS cache in Microsoft Windows (Win XP, Win ME, Win 2000):-
To flush the DNS cache in Linux, restart the nscd daemon:-
To flush the DNS cache in Mac OS X Leopard:-
To flush the DNS cache in Mac OS X:-
Ubuntu does not install a caching DNS server by default. Given the likelihood of your router or ISP is using a caching DNS server instead, it seems a bit silly to bother.
If you are having problems and aren't running nscd, check try resetting the next step in the DNS recusive lookup chain.
A small warning, If you need to flush a DNS cache, flushing it on your end machine may not work as expected. Generally the DNS cache on your end machine is fetched from the closest possible DNS server, which is generally on your primary router/dhcp server.
This will not be obvious to most, but it might explain why when you try to execute the aforementioned linux DNS cache flushes you find
You need to check your networks dns-server/router/firewall/modem manual / user interface for how this works. Generally rebooting them does the trick, but be warned, I have seen boxes that memorize DNS caches over reboot.
And even then, when you've done all of the above right, you could go straight ahead and pollute your DNS cache with a false entry the first time you look outside your network to the nearest hop, usually your ISP, who are prone to having a stale DNS cache.