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

Other Method: change nameserver

Change file /etc/resolv.conf

# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4

or

# Generated by NetworkManager
nameserver 1.1.1.1
nameserver 1.0.0.1

Recent search terms:

  • centos сбросить dns кэш

2 Comments

Leave a Reply