FreeKB - Bind Named DNS Flush DNS cache on Docker
Bind Named DNS - Flush DNS cache on Docker

This assumes you have installed Bind on Docker, and that Bind is up and running.

The rndc dump -cache command can be used to create a file of the current DNS cache. 

docker exec bind rndc dumpdb -cache

 

This will create a file named named_dump.db in the "directory" defined in your named.conf.options file, which is /var/cache/bind by default.

options {
  directory "/var/cache/bind";
  dnssec-validation auto;
  listen-on-v6 { any; };
};
 

 

The dump file should contain A records like this.

www.google.com.         604693  A       142.250.190.36

 

You can then issue these commands to flush the DNS cache.

~]# docker exec bind rndc flush
~]# docker exec bind rndc reload
server reload successful

 

You would then remove the old cache_dump.db file, generate a new cache_dump.db file, and there should be no A records in the newly created cache_dump.db file.

docker exec bind rm /var/cache/bind/cache_dump.db
docker exec bind rndc dumpdb -cache

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter 73e9f in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |