News:

SMF - Just Installed!

Main Menu

How to flush DNS cache on Linux ?

Started by whackowebmaster, February 14, 2014, 12:16:12 AM

Previous topic - Next topic

whackowebmaster

Hi All,

My first post on this forum to educate Linux users  :P

Nscd is a daemon that provides a cache for the most common name service requests. The default configuration file, /etc/nscd.conf, determines the behavior of the cache daemon. There are two caches for each database: a positive one for items found, and a negative one for items not found.  Each cache has a separate TTL (time-to-live) period for its data.  Note that the shadow  file  is  specifically  not  cached.  getspnam(3)  calls  remain uncached as a result.  As a result of this behavior it is not possible to change non-nscd user to another non-nscd user via su service when nscd is running.

You can flush your DNS cache on Linux with commands below.

1. Login to your server via SSH.

2. Restart the nscd service with command

Quoteroot@home [/]# /etc/init.d/nscd restart

Not all the Linux OS comes with nscd service pre installed. You will have to use yum OR apt-get depending on the distros to install it. Install nscd-2.12-1.132 rpm for the nscd service.