How to flush DNS cache on CentOS


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

or

service named restart

or

/etc/init.d/named restart

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

rndc restart

OR

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 tutorialspots.com[/ domain:

rndc flushname tutorialspots.com

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

1 Comment

Leave a Reply