name service cache daemon (nscd
) cache is persistent by default on CentOS 7, to flush it, you need to run:
nscd -i hosts
-i
stands for invalidate.
You can also check if nscd
‘s cache is persistent by running
nscd -g
![Flush nscd DNS cache image 81 - Flush nscd DNS cache](https://i0.wp.com/pcx3.com/wp-content/uploads/2022/04/image-81.png?resize=490%2C879&ssl=1)
nscd
caches several other types of data (not just DNS entries), so if you’re looking for the DNS cache specifically, make sure to look under the hosts cache
section:
![Flush nscd DNS cache image 82 - Flush nscd DNS cache](https://i0.wp.com/pcx3.com/wp-content/uploads/2022/04/image-82.png?resize=532%2C441&ssl=1)