Skip to content

addressing: resolve dns, dns4, dns6 and dnsaddr multiaddrs #249

Description

@adust09

Spec

specs/addressing/README.md, IP and Name Resolution.

The addressing recommendation defines resolution for /dns, /dns4, /dns6, and /dnsaddr; only the name-based component is replaced while the encapsulated transport suffix is retained.

Current state

LibP2P.Multiaddr.Protocol parses and renders all four DNS components, but Transport.TCP.canDialTCP, multiaddrToHostPort, and tcpDial accept only literal /ip4/.../tcp/... and /ip6/.../tcp/... addresses. Thus syntactically supported DNS multiaddrs cannot be dialled.

Scope

  • Resolve /dns through A and AAAA records, preferring IPv6 as specified while retaining usable fallbacks.
  • Resolve /dns4 through A records only.
  • Resolve /dns6 through AAAA records only.
  • Resolve /dnsaddr through _dnsaddr.<name> TXT records and recursively parse the returned dnsaddr= multiaddrs.
  • Preserve encapsulated suffixes such as /tcp/.../p2p/... during resolution.
  • Bound recursion, result count, lookup time, and malformed TXT handling.
  • Integrate resolution with Switch dialing without making the TCP transport falsely claim unsupported address shapes.

Acceptance tests

  • Deterministic resolver tests for dns/dns4/dns6/dnsaddr.
  • TCP dial through a name-based multiaddr using an injected/local resolver.
  • Multiple answers fall back after a failed address.
  • Recursive/cyclic dnsaddr records terminate safely.
  • /p2p/<peer-id> suffix and peer identity verification survive resolution.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions