服务器上开启DNS缓存服务——nscd

Linux默认没有dns缓存,所以当Linux使用一些要求查询dns服务较多的场景下,就会造成延时高,或者无法查询的可能性。安装nscd可以解决这个问题。阿里云的服务器一般默认有安装,并且已经配置好了,直接开启即可

 

如果没有安装yum安装:
yum install nscd -y
apt-get install -y nscd

 

nscd 的配置文件默认路径为/etc/nscd.conf


启动NSCD进程
service nscd start


加入自启动
chkconfig nscd on

查看进程
ps aux | grep nscd

查看统计信息
nscd -g

重启
service nscd restart

 

 

 

 

 

有一些服务器没有安装nscd的可以进行安装配置:配置可以参考以下资料:

 

https://blog.csdn.net/weixin_36995644/article/details/82838800
https://www.cnblogs.com/chai-/p/10520891.html
https://www.cnblogs.com/EasonJim/p/10014517.html
https://blog.csdn.net/zzhongcy/article/details/89089404
https://blog.csdn.net/weixin_34217773/article/details/91494353