DNS caching occurs at multiple levels:
Application asks local system,
which asks locally configured resolving DNS server,
which asks authoritative DNS servers.
Caching by Application varies.
- I've found for Firefox that quitting and restarting works. The relevant settings in
about:config are network.dnsCacheEntries and network.dnsCacheExpiration, which can be set to 0 in order to disable caching.
Caching by local system is typically 1 hour.
- Diagnostic: ping, like other applications, uses local system DNS cache
- Flush MacOsX 10.8:
sudo killall -HUP mDNSResponder (reference)
(May vary for other versions)
- Flush Windows:
ipconfig /flushdns (only if the DNS caching service, HKLM\SYSTEM\CurrentControlSet\Services\Dnscache, is enabled; check with net start|findstr /i dns or compmgmt.msc)
- Linux/Unix may use
nscd (name services caching daemon), or dnsmasq, or both ...
Caching by local resolving DNS server may run to several days, depending on TTL associated with DNS record.
- Diagnostic:
nslookup first reports address of resolving server, then address requested.
- Flush BIND:
rndc flush or rndc flushname DOMAIN.NAME
TTL stands for "time to live" a term used to describe how long a DNS record is to be deemed valid by the requesting client or server. A short TTL means that the requester is told not to cache a DNS lookup for too long. The TTL can range from mere seconds (e.g. for DynDNS and similar) to days or weeks.