Struct DnsDiscovery
pub struct DnsDiscovery { /* private fields */ }Expand description
DNS node discovery
When asked to resolve a NodeId, this service performs a lookup in the Domain Name System (DNS).
It uses the Endpoint’s DNS resolver to query for TXT records under the domain
_iroh.<z32-node-id>.<origin-domain>:
_iroh: is the record name<z32-node-id>is theNodeIdencoded inz-base-32format<origin-domain>is the node origin domain as set inDnsDiscovery::builder.
Each TXT record returned from the query is expected to contain a string in the format <name>=<value>.
If a TXT record contains multiple character strings, they are concatenated first.
The supported attributes are:
relay=<url>: The URL of the home relay server of the node
The DNS resolver defaults to using the nameservers configured on the host system, but can be changed
with crate::endpoint::Builder::dns_resolver.
Implementations§
§impl DnsDiscovery
impl DnsDiscovery
pub fn builder(origin_domain: String) -> DnsDiscoveryBuilder
pub fn builder(origin_domain: String) -> DnsDiscoveryBuilder
Creates a DnsDiscoveryBuilder that implements IntoDiscovery.
pub fn n0_dns() -> DnsDiscoveryBuilder
pub fn n0_dns() -> DnsDiscoveryBuilder
Creates a new DNS discovery using the iroh.link domain.
This uses the N0_DNS_NODE_ORIGIN_PROD domain.
§Usage during tests
For testing it is possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::builder. This would then use a hosted staging discovery
service for testing purposes.