Skip to content

litep2p: default DNS resolver config silently has zero nameservers (hickory-resolver 0.26) #587

@n13

Description

@n13

Problem

hickory-resolver 0.26 changed ResolverConfig::default() from Google's nameservers (0.24 behavior) to a derived Default with an empty name_servers list.

The vendored litep2p only reads the system DNS config when use_system_dns_config is set (via ConfigBuilder::with_system_resolver()). Otherwise it builds the resolver from Default::default():

https://github.com/Quantus-Network/chain/blob/main/client/litep2p/src/lib.rs#L157-L168

That default path constructs a resolver with zero nameservers, so every /dns/... lookup fails silently (NoConnections, 0 peers) — exactly the failure mode fixed at the call site in #586.

Footgun

#586 fixes the only production call site, but the opt-in flag remains. Any future Litep2p consumer that forgets .with_system_resolver() silently reinherits a dead DNS resolver.

Proposal

Since the vendored litep2p is only consumed in-repo, make system DNS config the unconditional behavior in Litep2p::new and drop the use_system_dns_config flag / with_system_resolver() builder method. Startup already fails loudly with Error::CannotReadSystemDnsConfig when the system config can't be read, which is the behavior we want everywhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions