routedns icon indicating copy to clipboard operation
routedns copied to clipboard

Pre-load cache with content

Open cbuijs opened this issue 3 years ago • 2 comments

See here as example: https://docs.powerdns.com/recursor/lua-config/ztc.html

It might be handy to have an feature for the case to pre-load it with content when starting. I think the following functionality makes sense:

  1. Pre-load cache at startup
  2. Refresh content as the cache already does
  3. Save cache at shut-down so it can pre-load at startup again, retaining cache.

cbuijs avatar Feb 09 '22 09:02 cbuijs

Perhaps 1) and 2) could be done if there was a cron element that could emit queries on a configurable schedule. That could be sitting behind a cache and keep it populated. It could likely be used for other purposes too, like flushing the cache.

As for 3), that should be doable. The issue there is that elements don't at the moment have a way to react to a "shutdown" request, there's no signal. But having one could be quite useful in other cases too

folbricht avatar Feb 13 '22 15:02 folbricht

Maybe on 1): Make it loadable from a file, preferable rfc1034/1035 formatted that can be loaded locally from a file, URL or even zone-transfer/AXFR. When file, the operator of RouteDNS can decide what to do with system-cron/scripting/etc to have the file fresh.

On 2): the refresh would be just executing 1) when expiry hits (maybe definable, or taken from SOA of the file). We might need a "reload/refresh now" functionality.

Above probably makes 3) redundant/simpler, but having a save/dump function solves this and leave it to the operator of RouteDNS to figure it out (maybe something like the cache "flush" query, but then for dump).

Some URL's that could/can be used on 1) for research/info/data: https://www.internic.net/domain/root-servers.net.zone https://www.internic.net/domain/root.zone https://www.internic.net/domain/arpa.zone https://www.internic.net/domain/in-addr.arpa.zone" https://www.internic.net/domain/ip6.arpa

cbuijs avatar Feb 14 '22 07:02 cbuijs

This is now possible with the persistent cache feature #299 .

cbuijs avatar Aug 22 '23 10:08 cbuijs