DNS.Resolvers should be used for DNS multiaddrs: /dnsaddr /dns /dns4 /dns6 #9199
Labels
help wanted
Seeking public contribution on this issue
kind/bug
A bug in existing code (including security flaws)
need/triage
Needs initial labeling and prioritization
topic/dns
Version
Bug description
DNS.Resolvers
allows for setting DNS over HTTPS resolver per domain or globally (.
catch-all).Custom DNS resolver set there is:
Threat model
Peer addresses include
/p2p/{libp2p-key}
, which removes the surface for MITM, so no peer identity spoofing / tampering is possible.However, a privacy/censorship concern remains. DNS resolver provided by the operating system (delegating queries to user's ISP in cleartext) may lie about IPs, or simply return no TXT records, which will block access to things like bootstrappers at
/dnsaddr/bootstrap.libp2p.io/
, effectively cutting off user from IPFS network.How to reproduce
To confirm that
DNS.Resolvers
is used for DNSLink, but not for DNSAddr, set bootstrap to DNS-only peers AND set DNS resolver to invalid one (which should always fail):After rebooting your daemon (with fresh repo, no prior peers cached, no mdns):
ipfs resolve /ipns/en.wikipedia-on-ipfs.org
will fail withcould not resolve name
ipfs swarm connect /dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN
will connect just fine.invalid
DoH resolved was not used – we expected connection to fail the same way dnslink did, but it worked. this meansDNS.Resolvers
are not applied to multiaddrs, only to DNSLink.What is interesting, doing manual
ipfs swarm connect /dnsaddr/ipfs.aergia.eu
fails as expected:So.. parts are wired up (manual
swarm connect
), parts are not (bootstrappers).Expected behavior
DNS.Resolvers
(if defined) should be used for resolving all DNS-based multiaddrs, namely:/dnsaddr
/dns
/dns4
/dns6
Related
cc libp2p/go-libp2p#1607
The text was updated successfully, but these errors were encountered: