0

How many DNS-records fits in the recommended 10 MB cache?

Just curious how many DNS-entries fits in the recommended 10 MB cache in CLI? Will it add records until the 10 MB is filled in memory and then the oldest record will be replaced or is stale DNS-records deleted in advance? I read that it works as a sort of redundancy if the DNS-servers can't be reached, but does it also use stale DNS-records in that scenario?

When I have checked the command "nextdns cache-keys" a few times the largest mine have been is around 1.500 entries, but is this maxed out? Any way to check how much the cache is filled up (in % or MB) any time or should we just use 10 MB and not ask any questions? 😉

8replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • That's is correct, it will keep stale records in memory and use them in case of issue talking to the upstream. Least used entries are replace with new onces the cache reaches the 10MB size. 10MB can hold a lot of records if you consider a typical DNS response is in the 50-100 bytes.

    Like 2
      • Jörgen
      • Pro subscriber ✅
      • Jorgen_A
      • 1 mth ago
      • Reported - view

      NextDNS Thanks for the answer! So if my math is correct a cache of 10 MB will then store ~100.000-200.000 entries if each record is 50-100 bytes. That's a lot! 😋

      Like
    • Jörgen it's decent yes :)

      Like
  • Would it be fair to say the 10MB setting is to prevent a malfunction from using too much space rather than for performance reasons?

    Like
    • Calvin Hobbes I'm not sure to get the question.

      Like
  • I guess me changing that too 100mb was kind of pointless then 💥

    Like
      • Jörgen
      • Pro subscriber ✅
      • Jorgen_A
      • 4 wk ago
      • Reported - view

      Mark Wow, that's a cache-size for a global enterprise company. 😉 I lowered mine to 4 MB (~40.000-80.000 records), but even 1-2 MB would probably be more than enough for most home networks.

      Like
      • Mark
      • MarkToon
      • 4 wk ago
      • 1
      • Reported - view

      Jörgen Ha ha yeah sounds like I went OTT, though I must say it's been running rather nicely.

      Like 1
Like Follow
  • 4 wk agoLast active
  • 8Replies
  • 120Views
  • 4 Following