Known DNSLink and IPNS should work in airplane mode
- Dominant language
- Go
- Stars
- 17.1k
- Forks
- 3.2k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 11
Description
When the user unplugs internet connection, previously visited DNSLink websites with low TXT record TTL will return error:
```
ipfs resolve -r /ipns/en.wikipedia-on-ipfs.org: could not resolve name
```
This is unfortunate, because the user's node has all the data required for loading the website.
Vendors like Brave should be able to load previously visited websites in offline mode using last-known DNSLink.
## Improvement proposal
Update https://github.com/ipfs/go-namesys to:
* keep a separate fallback cache of known DNSLinks and IPNS records
* when record refresh fails (TTL expired + unable to reach DNS server) return last-known value from the fallback cache
This way the user can load `ipns://en.wikipedia-on-ipfs.org` (Brave) or `http://en.wikipedia-on-ipfs.org.ipns.localhost:8080` (local gateway) even when in airplane mode.
Open question: is this a good default for all use cases? If not, we could add `NoNamesysRecoveryCache` configuration option to [`Gateway`](https://github.com/ipfs/go-ipfs/blob/master/docs/config.md#gateway) to allow override of default behavior and force hard record expiration based on TTL and require DNS/IPNS lookup to always succeed.
Contributor guide
Assessment
This issue has not been assessed yet.