Viewing DNS cache entries

Dan Nelson dnelson at allantgroup.com
Tue Apr 5 08:36:36 PDT 2005


In the last episode (Apr 05), Martin Petraschek said:
> The operating system is caching DNS name resolutions in order to
> avoid repeated DNS requests for the same hostname. Is it possible to
> display the entries of that DNS cache?
> 
> Under Windows, the command "ipconfig /displaydns" exists, and I would
> need that functionality under FreeBSD.

You can use the "rndc dump" command, which will create a file that
contains all of the currently-cached DNS entries.  If you are running a
chrooted named (default in 5.*), add this line to
/etc/namedb/named.conf in the options{} section:

        dump-file "/var/dump/named_dump.db";

, then run "rndc reconfig" and "rndc dump".  The dumpfile will end up
in /var/named/var/dump/named_dump.db.

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-questions mailing list