How to flush DNS cache on CentOS


Flush caching BIND server DNS cache
A caching BIND server obtains information from another server (a Zone Master) in response to a host query and then saves (caches) the data locally. All you have to do is restart bind to clear its cache:

systemctl restart named


service named restart


/etc/init.d/named restart

You can also use rndc command as follows flush out all cache:

rndc restart


rndc exec

BIND v9.3.0 and above will support flushing all of the records attached to a particular domain name with rndc flushname command. In this example flush all records releated to[/ domain:

rndc flushname

It is also possible to flush out BIND views. For example, lan and wan views can be flushed using the following command:

rndc flush lan
rndc flush wan


Leave a Reply