# DNS Cache on FreeBSD



## watcher00090 (Sep 1, 2022)

Hi,

Anyone know the directory in which FreeBSD keeps the DNS cache?

Thank you,
James Pedersen


----------



## watcher00090 (Sep 1, 2022)

You know what, never mind, don't worry about this question, it's not super relevant to me.


----------



## SirDice (Sep 1, 2022)

watcher00090 said:


> Anyone know the directory in which FreeBSD keeps the DNS cache?


Yes, there isn't any. Unless you enabled something like nscd(8) for example.


----------



## watcher00090 (Sep 1, 2022)

Actually I am interested in this question, upon second thought. 

So supposing you did enable nscd, where would that store the DNS cache? Do you know?


----------



## gpw928 (Sep 1, 2022)

The manual page for nscd.conf(5) suggests that the (per user) cache is "internal", i.e. memory resident.


----------



## rotor (Sep 2, 2022)

watcher00090 said:


> Anyone know the directory in which FreeBSD keeps the DNS cache?



In my experience using the unbound resolver in a low-volume environment, I see the following behavior...

The cache seems to be memory based.

When I stop and restart unbound, the cache is cleared.


----------

