Gateway: ensure consistent caching of DNS records #480
Labels
dif/easy
Someone with a little familiarity can pick up
effort/hours
Estimated to take one or several hours
kind/bug
A bug in existing code (including security flaws)
P2
Medium: Good to have, but can wait until someone steps up
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
The text was updated successfully, but these errors were encountered: