Flush DNS cache on Centos Server
I have a client with a Centos 6.9 server acting as the internal DNS server. This client made some DNS changes through register.com for their domain. If the TTL (time to live) for the DNS record is too long the local DNS server will not refresh the entry until the TTL expires. If you confirm that a public DNS lookup is showing the correct DNS record and your local DNS server does not have the update yet, the below steps to manually flush dns cache may work for you.
- SSH into your Centos Server as an account that has the necessary permissions (root works)
- Enter “service nscd restart” and press enter
- Enter “/etc/init.d/dnsmasq restart” and press enter
- Enter “nslookup [domainname.com]” and press enter to confirm the record is refreshed
This may not work for everyone or for every version of Centos but It Fixed it for me.
Hope it helps.