Gateway: ensure consistent caching of DNS records
- Dominant language
- Go
- Stars
- 316
- Forks
- 163
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 8
Description
The gateway code uses https://github.com/multiformats/go-multiaddr-dns which by default would use `net.DefaultResolver` and not cache anything. It also registers two default resolvers for `.eth` and `.crypto`. In this case using DoH urls for which it uses https://github.com/libp2p/go-doh-resolver, which does include caching of results.
This means some dns results are going to be cached while others depend on what DNS resolver Go is actually using (which depends on CGO iirc). When not using CGO, Go would use its own resolver and not cache anything. When using CGO, go would use the system's resolver which may or not cache stuff depending what is on the system.
Is my understanding correct @lidel ?
Ideally we should be caching all results. This has been used before in the ecosystem: https://github.com/rs/dnscache
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.