Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
number of entries in BIND cache
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
tnt
Veteran
Veteran


Joined: 27 Feb 2004
Posts: 1227

PostPosted: Wed Nov 13, 2019 2:35 pm    Post subject: number of entries in BIND cache Reply with quote

Hello.

Is there any simple way to find out number of (still valid/not expired) entries currently residing in BIND cache? :roll:

Thx.
_________________
gentoo user
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 513
Location: San Diego, California USA

PostPosted: Wed Nov 13, 2019 11:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
tnt
Veteran
Veteran


Joined: 27 Feb 2004
Posts: 1227

PostPosted: Thu Nov 14, 2019 9:49 am    Post subject: Reply with quote

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
View user's profile Send private message
araxon
Tux's lil' helper
Tux's lil' helper


Joined: 25 May 2011
Posts: 85

PostPosted: Tue Nov 26, 2019 7:01 am    Post subject: Reply with quote

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
View user's profile Send private message
tnt
Veteran
Veteran


Joined: 27 Feb 2004
Posts: 1227

PostPosted: Tue Nov 26, 2019 2:53 pm    Post subject: Reply with quote

thx a lot !

I will test it!
_________________
gentoo user
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum