Sometimes your system caches too much on DNS query / records.
DNS caching helps alot on reducing time and bandwidth when your application needs DNS informations, but just like anything else in the world; it’s not a good thing when it does too over.
Let’s see how to flush DNS cache in your system.
$ sudo /etc/init.d/dns-clean restart
Flush nscd DNS cache:
$ sudo /etc/init.d/nscd restart
$ sudo service nscd restart
$ sudo service nscd reload
$ sudo nscd -i hosts
Flush dnsmasq dns cache
$ sudo /etc/init.d/dnsmasq restart
Flush caching BIND server dns cache
$ sudo /etc/init.d/named restart
$ sudo rndc flush
Originally published at blog.geeky.name on September 24, 2009.