According to Red Hat, “[t]he Name Service Caching Daemon (nscd) is a service that runs in the background and keeps a copy of /etc/passwd, /etc/group, [/etc/netgroup, /etc/services] and /etc/hosts files in /var/db/nscd/ directory. This can aid performance by reducing disk read overhead on a heavily loaded system dealing with many logins or name resolution requests.”
The installation and usage is easy enough for a CentOS 6 install.
yum install nscd
service nscd start
chkconfig nscd on
This works right out of the box, however, there is a config file than can be edited (/etc/nscd.conf). It can be read using the following command.
nscd -g
To test it.
time nslookup www.google.com
To flush the cache.
service nscd restart
Source(s)
- http://prefetch.net/blog/index.php/2011/03/27/configuring-nscd-to-cache-dns-host-lookups/
- http://www.unixmantra.com/2014/07/how-to-enable-name-service-cache-daemon-nscd.html
- https://access.redhat.com/solutions/1489