Flush nscd DNS cache

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

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:

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.