As we all know, Linux itself is not with the DNS cache.
You can install NSCD to turn on the Linux system DNS cache.
1. Installation:
Yum-y Install NSCD
2. Modify the configuration file:
Vim/etc/nscd.conf
Logfile/var/log/nscd.log
Threads 4
Max-threads 32
Server-user NSCD
Debug-level 0
Reload-count 5
Paranoia No
Restart-interval 3600
Enable-cache hosts Yes
Positive-time-to-live hosts 3600
Negative-time-to-live hosts 20
Suggested-size hosts 211
Check-files hosts Yes
Persistent hosts Yes
Shared hosts Yes
Max-db-size hosts 33554432
3. Restart the NSCD service.
/ETC/INIT.D/NSCD restart
NSCD Cache Three Services passwd group hosts, so it will record three libraries, corresponding to the source/etc/passwd,/etc/hosts and/etc/resolv.conf each library to save two copies of the cache, one is to find records, one is not found records. Each cache is saved with a time-to-Live (TTL).
Turn on, stop, restart the service
Sevices NSCD Start | Stop | Restart
Cache db file under/VAR/DB/NSCD
Nscd-g Viewing statistics
Clear Cache
Nscd-i passwd
Nscd-i Group
Nscd-i hosts
Add: Turn on the NSCD cache service to speed up DNS resolution
This article is from "Effort!" Struggle! "Blog, be sure to keep this provenance http://026mm.blog.51cto.com/8783374/1787835
Linux system DNS Caching service NSCD