ipfs / ipfs/kubo

Known DNSLink and IPNS should work in airplane mode

Open
#8,245 1 comment 11 reactions 0 assignees View on GitHub
kind/bug need/triage topic/gateway topic/ipns
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.