kubo/core
Marcin Rataj 7de7af0820
feat(dns): skip DNS lookups for AutoTLS hostnames (#11140)
* feat(dns): resolve libp2p.direct addresses locally without network I/O

p2p-forge hostnames encode IP addresses directly (e.g., 1-2-3-4.peerID.libp2p.direct -> 1.2.3.4),
so DNS queries are wasteful. kubo now parses these IPs in-memory.

- applies to both default libp2p.direct and custom AutoTLS.DomainSuffix
- TXT queries still delegate to network for ACME DNS-01 compatibility

- https://github.com/ipfs/kubo/pull/11140#discussion_r2683477754
  use fallback to network DNS instead of returning errors when local
  parsing fails, ensuring forward compatibility with future DNS records

- https://github.com/ipfs/kubo/pull/11140#discussion_r2683512408
  add peerID validation using peer.Decode(), matching libp2p.direct
  server behavior, with fallback on invalid peerID

- https://github.com/ipfs/kubo/pull/11140#discussion_r2683521930
  document interaction with DNS.Resolvers in config.md

- https://github.com/ipfs/kubo/pull/11140#discussion_r2683526647
  add AutoTLS.SkipDNSLookup config flag to disable local resolution
  (useful for debugging or custom DNS override scenarios)

- https://github.com/ipfs/kubo/pull/11140#discussion_r2683533462
  add E2E test verifying libp2p.direct resolves locally even when
  DNS.Resolvers points to a broken server

additional improvements:
- use madns.BasicResolver interface instead of custom basicResolver
- add compile-time interface checks for p2pForgeResolver and madns.Resolver
- refactor tests: merge IPv4/IPv6, add helpers, use config.DefaultDomainSuffix
- improve changelog to explain public good benefit (reducing DNS load)

Fixes #11136
2026-01-30 17:20:56 +01:00
..
commands fix(commands/reprovide): update manual reprovide error message (#11151) 2026-01-21 05:59:56 +01:00
coreapi keys: skip bad keys when listing (#11115) 2026-01-07 09:56:11 -08:00
corehttp feat(config): add Gateway.MaxRequestDuration option (#11138) 2026-01-15 19:31:16 +01:00
coreiface refactor: replace context.WithCancel with t.Context (#11083) 2025-11-28 16:39:55 +01:00
corerepo chore: use go-log/v2 (#10801) 2025-05-19 13:04:05 -07:00
coreunix fix(ci): parallelize gotest, cleanup output, flakiness (#11113) 2026-01-08 05:07:08 +01:00
mock fix: deadlock on retrieving WebTransport addresses (#9857) 2023-05-08 16:11:03 +02:00
node feat(dns): skip DNS lookups for AutoTLS hostnames (#11140) 2026-01-30 17:20:56 +01:00
.gitignore ignore testdb 2014-07-05 15:04:04 -07:00
builder.go chore: migrate bootstrap to ipfs/boxo (#10158) 2023-10-31 18:25:14 +01:00
core_test.go feat(cli/rpc/add): fast provide of root CID (#11046) 2025-11-14 11:08:29 -08:00
core.go feat(cli/rpc/add): fast provide of root CID (#11046) 2025-11-14 11:08:29 -08:00