Flush DNS Resolver Cache in Linux
Posted by kranny on September 11th, 2009;This post is viewed 1,779 times
Just to give a heads up on what DNS resolver cache is,It is the cached results of DNS queries by DNS clients(ex Browsers)to speed up multiple lookups to the same URL.So if u browse a site for say 2 hours,imagine how many requests are made to the same domain.So it is better to cache the DNS response in order to fasten the browsing.
Her comes the negative part.If you have an invalid DNS entry cached on your local client,browsing isn’t possible anymore.This is the reason why many people complain saying that they cannot open a particular site.I recommend them to trace route to the site which isn’t showing and see if there is a request time-out error.you have to flush the cache so that your client can do a new lookup and get the correct information.
Flushing Part
In windows you use an ipconfig switch(ipconfig /flushdns) to clear the dns resolver cache.But most of the linux flavours doesnt run cache service(nscd).If you ever installed it,and have the daemon running, simply restart the service.
To restart the nscd daemon,
sudo /etc/init.d/nscd restart



