Skip to content
Calcrivo

DNS Cache Calculator

Size a resolver cache and predict its hit ratio from query rate, unique names and record TTL.

Inputs

queries/s
names
s
bytes

Cache Memory Required

4 MiB

Cached Entries

20,000

Cache Hit Ratio

98.67%

Upstream Query Rate

66.7queries/s

Cache Memory Required

4.20MB

Step by step

  1. Values used

    Query rate = 5,000 queries/s; Distinct names in the working set = 20,000 names; Average record TTL = 300 s; Memory per cache entry = 220 bytes

  2. DNS Cache

    cached entries = min(unique names, query rate × TTL); misses per second = unique names ÷ TTL.

  3. Cache hit ratio

    hit ratio = 1 − misses per second ÷ query rate

  4. Cache Memory Required

    = 4,400,000

  5. Cached Entries

    = 20,000

  6. Cache Hit Ratio

    = 98.67

  7. Upstream Query Rate

    = 66.7 queries/s

  8. Cache Memory Required

    = 4.20 MB

How it works

Each distinct name has to be fetched from upstream once per TTL, so the miss rate is the working-set size divided by the TTL — independent of how often clients ask. Everything else is served from cache, and memory follows from the number of entries held. Cache sizing decides both resolver memory and upstream load: shortening TTLs from 300 to 30 seconds multiplies authoritative query volume tenfold without changing client behaviour at all.

Formulas

DNS Cache

cached entries = min(unique names, query rate × TTL); misses per second = unique names ÷ TTL.

unique names
Distinct records queried in the working set
TTL
Average record lifetime in seconds
misses per second
Each name must be re-resolved once per TTL

Cache hit ratio

hit ratio = 1 − misses per second ÷ query rate

query rate
Total client queries per second

Frequently Asked Questions

How is DNS Cache calculated?

cached entries = min(unique names, query rate × TTL); misses per second = unique names ÷ TTL. Each distinct name has to be fetched from upstream once per TTL, so the miss rate is the working-set size divided by the TTL — independent of how often clients ask. Everything else is served from cache, and memory follows from the number of entries held.

Why does DNS Cache matter?

Cache sizing decides both resolver memory and upstream load: shortening TTLs from 300 to 30 seconds multiplies authoritative query volume tenfold without changing client behaviour at all.

What values do I need to enter?

This calculator takes 4 inputs: Query rate, Distinct names in the working set, Average record TTL, Memory per cache entry. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.

You might also need