BIND (forwarder+cached) – serve cached if forwarder fails

binddomain-name-system

I want to configure BIND as DNS forwarder and utilize caching too.

How can I configure it to serve cached results (even if beyond TTL) if forwarder fails?

This questions was already asked here but there was no answer posted – How to make BIND return old cached enties if all forwarders are failed?

Reason I need to do this, I have very bad ISP (and don't have better alternative available in my area). Often, all DNS lookup requests fails, I tried many free dns providers, they all fail during that period. Internet connectivity is not down, only DNS queries fails.

That's the reason behind my requirement, so when that happens, I can still continue doing my work, with cached DNS results (obviously which already exists in cache).

Best Answer

Using expired data is a really strong "must not" in the standards, so it would surprise me greatly if it's possible to get BIND to do that at all. You may want to look into alternative resolvers more closely aimed at personal use, or (since it sounds like your ISP intermittently blocks traffic to port 53) try getting a VPN tunnel and have your BIND use that.