Need some explanation about BIND9 cache


Cache of BIND is kinda of a "Black hole" for me. I know about TTL and that it can be overridden. I know that there's a way to dump cache into a file that could be viewed in a text editor. But, still, lots of things are in the dark. I've read that once you reboot, the cache is lost. Then why to build the cache from scratch each time you turn on your computer? What, like BIND's building its cache for a few hours when the server is on and then simply loose it? That doesn't make sense. Why it can't be kept in a file or in a database? Is it a limitation or something good? Unfortunately, I didn't find in books or on the Internet clear information about all of this. So please explain it to me in simple English OR just provide the links to the relevant source of information.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jan SpringerCommented:
Zone data that has been retrieved is stored in cache.  Cache is stored in memory.

So, when bind is restarted, the cache is dumped via rndc, or the computer is restarted, cache is lost.

The purpose of the cache is to limit the number of external queries that need to take place to retrieve zone data.  This reduces computer cycles, bandwidth, and time.  

Zone data in the cache should be purged when it hits it ttl.

It's not meant to be a static database nor should it be.
You have lots of RAM and fast network links. Saving cache to disk was removed in BIND9.
Normally DNS server can stay running for months until you need to apply some critical security patch.
Why are you restarting server often? Is there any problem you are tryingto solve by restarts?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
David1978Author Commented:
Thank you both for your replies!
Yeah, you're probably right! I just didn't think of it this way. I mean, normally you would have a production DNS server in some server farm where it's very rarely happens when the DNS servers would be shut down. Most likely queries' TTL's expire faster than that.
No problem here. Just curiosity mostly.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.