With more and more devices and internet connections supporting IPv6, which allows you to reach every device behind a router directly without NAT, I plan on using the same domain for my devices whether I access them from inside my LAN or outside.
I am using Cloudflare DNS to add AAAA records for all of my machines to my domain so I can reach them with .example.com, from inside and outside of my LAN (with proper firewall rules)
However, using Cloudflare as my "internal" DNS would mean, that when my internet connection is gone, I can't reach my local devices as soon as they fall out of the nameserver cache of my local Bind server. I probably could add extremely long cache times for the domain but I do not want that.
But I also do not want DNS from outside having to rely on the internal DNS server working.
What I am looking for is a way to make the local Bind server cache every record of my *.example.com zone, but always look up requests at the real DNS server, i.e. perform a normal lookup like it would for google.com. Only if that nameserver doesn't respond or responds with an error, Bind should return the result from its cache. That way, I could host the DNS records at Cloudflare, using its API to manage my zone, having all requests use the up-to-date Cloudflare zone, but if the internet connection is gone, still have a cached copy on the local server.
Is that possible?