Force DNS refresh for ping in CentOS7

I came across an issue where I updated /etc/resolv.conf but name resolution wasn’t working in Cent7. nslookup & host both returned results, but ping did not. After some digging, I found this post which mentioned name service cache daemon. After restarting it, DNS worked properly! So if you update DNS, be sure to also restart NCSD:

sudo systemctl restart ncsd

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.