I'm running the Bind nameserver on CentOS 4.2. Can anyone tell me where the cached lookups are stored and whether there is a way to view them?
Kill -2 of named will cause it to dump the cache. Depends on whether it is running in a chrooted directory or non. Try /var/named/chroot/var/named then you should find something like dump.db if my memory serves me correctly.
Sam
On 27/01/06, Sam Drinkard sam@wa4phy.net wrote:
Kill -2 of named will cause it to dump the cache. Depends on whether it is running in a chrooted directory or non. Try /var/named/chroot/var/named then you should find something like dump.db if my memory serves me correctly.
The dump file's configurable in named.conf (or presumable named.custom too.) In a non-chrooted environment it's dumped into /var/named/data/ You can also do an "rndc dumpdb" to get the cache dump.
[root@willspc wmcdonald]# rndc Usage: rndc [-c config] [-s server] [-p port] [-k key-file ] [-y key] [-V] command
command is one of the following:
reload Reload configuration file and zones. reload zone [class [view]] Reload a single zone. refresh zone [class [view]] Schedule immediate maintenance for a zone. reconfig Reload configuration file and new zones only. stats Write server statistics to the statistics file. querylog Toggle query logging. dumpdb Dump cache(s) to the dump file (named_dump.db). stop Save pending updates to master files and stop the server. halt Stop the server without saving pending updates. trace Increment debugging level by one. trace level Change the debugging level. notrace Set debugging level to 0. flush Flushes all of the server's caches. flush [view] Flushes the server's cache for a view. status Display status of the server. *restart Restart the server.
* == not yet implemented Version: 9.2.4
Will.
With rndc you can dump the cache in a file. You can read all about it in the man pages...
Iain M Lee wrote:
I'm running the Bind nameserver on CentOS 4.2. Can anyone tell me where the cached lookups are stored and whether there is a way to view them?
If you have RNDC configured (can't remember if it is by default) then it will output the named cache to a local file.
$ rndc dumbdb
That will create a file (configurable in /etc/named.conf) containing the named cache (mine is /var/named/data/cache_dumb.db, don't remember if this is the default).
This will not clear the current cache in RAM, just output it to file.
Hope that helps, Andrew