View previous topic :: View next topic |
Author |
Message |
tnt Veteran
Joined: 27 Feb 2004 Posts: 1227
|
Posted: Wed Nov 13, 2019 2:35 pm Post subject: number of entries in BIND cache |
|
|
Hello.
Is there any simple way to find out number of (still valid/not expired) entries currently residing in BIND cache?
Thx. _________________ gentoo user |
|
Back to top |
|
|
gentoo_ram Guru
Joined: 25 Oct 2007 Posts: 513 Location: San Diego, California USA
|
Posted: Wed Nov 13, 2019 11:23 pm Post subject: |
|
|
This answer is in regards to BIND. Other daemons might have different answers.
I don't see an easy way to get a number. But you can trigger named to do a database dump of its current cache database with the 'rndc dumpdb' command. That makes 'named' create a file called named_dump.db (by default) which shows up in the /var/bind directory assuming you are using the chroot option for running named from the standard Gentoo installation. The filename and path could be different depending on your configuration.
You'd have to process that dump file to make statistics. |
|
Back to top |
|
|
tnt Veteran
Joined: 27 Feb 2004 Posts: 1227
|
Posted: Thu Nov 14, 2019 9:49 am Post subject: |
|
|
gentoo_ram wrote: | This answer is in regards to BIND. Other daemons might have different answers.
I don't see an easy way to get a number. But you can trigger named to do a database dump of its current cache database with the 'rndc dumpdb' command. That makes 'named' create a file called named_dump.db (by default) which shows up in the /var/bind directory assuming you are using the chroot option for running named from the standard Gentoo installation. The filename and path could be different depending on your configuration.
You'd have to process that dump file to make statistics. |
Thx!
I got the file, but now the hard part of the story is to parse it correctly... _________________ gentoo user |
|
Back to top |
|
|
araxon Tux's lil' helper
Joined: 25 May 2011 Posts: 85
|
Posted: Tue Nov 26, 2019 7:01 am Post subject: |
|
|
tnt wrote: |
I got the file, but now the hard part of the story is to parse it correctly... |
Probably not the best, but it seems to work in my instance:
Code: | grep -P "\t[0-9]+\t[A-Z]+\t" /var/bind/named_dump.db | wc -l |
|
|
Back to top |
|
|
tnt Veteran
Joined: 27 Feb 2004 Posts: 1227
|
Posted: Tue Nov 26, 2019 2:53 pm Post subject: |
|
|
thx a lot !
I will test it! _________________ gentoo user |
|
Back to top |
|
|
|