#dns-resolution #transport #ip-address #p2p #addresses #protocols #resolve

xstack-dnsaddr

The libp2p dnsaddr transport implementation for xstack

3 releases

new 0.2.17 Sep 14, 2024
0.2.15 Aug 27, 2024
0.2.12 Aug 27, 2024

#2209 in Network programming

Download history 234/week @ 2024-08-25 9/week @ 2024-09-01 113/week @ 2024-09-08

356 downloads per month
Used in 2 crates

MIT license

205KB
4K SLoC

A decorator pattern implementation that adds IP and Name Resolution capabilities to other transports.

Most libp2p transports use the IP protocol as a foundational layer, and as a result, most transport multiaddrs will begin with a component that represents an IPv4 or IPv6 address.

This may be an actual address, such as /ip4/198.51.100 or /ip6/fe80::883:a581:fff1:833, or it could be something that resolves to an IP address, like a domain name.

DnsAddr attempt to resolve name-based multiaddrs into IP addresses before calling other transports. The current multiaddr protocol table defines four resolvable or "name-based" protocols:

protocol description
dns Resolves DNS A and AAAA records into both IPv4 and IPv6 addresses.
dns4 Resolves DNS A records into IPv4 addresses.
dns6 Resolves DNS AAAA records into IPv6 addresses.
dnsaddr Resolves multiaddrs from a special TXT record.

Dependencies

~76MB
~2M SLoC