Viewing DNS cache entries

Martin Petraschek petraschek at ftw.at
Wed Apr 6 00:38:38 PDT 2005


>In the last episode (Apr 05), Martin Petraschek said:
>> On Tue, 5 Apr 2005 10:36:35 -0500, Dan Nelson wrote:
>> >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
>> 
>> The rndc command does not exist on my 4.10 box.
>
>It was called "ndc" in bind 8 (which is what comes with 4.*).
> 
>> Anyhow, I am not running a nameserver on this machine. Is this a
>> prequisite for your suggestion to work?
>
>Yes; if you are not running a nameserver, then the OS won't cache any
>DNS entries at all.  Every lookup will result in a DNS request to one
>of the servers listed in /etc/resolv.conf.  Maybe you have some static
>entries in /etc/hosts?  That file is checked before DNS; edit
>/etc/host.conf to change the lookup order.

Thank you, Dan. I was not aware of the fact that FreeBSD does not cache 
DNS entries unless you are running a name server.





More information about the freebsd-questions mailing list