Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ic-bn-lib-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license.workspace = true
readme.workspace = true
keywords.workspace = true
description = "A collection of traits & types commonly used by ic-bn-lib and others"
version = "0.1.3"
version = "0.1.4"
documentation = "https://docs.rs/ic-bn-lib-common"

[dependencies]
Expand Down
7 changes: 7 additions & 0 deletions ic-bn-lib-common/src/types/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ pub struct Options {
pub cache_size: usize,
pub timeout: Duration,
pub tls_name: String,
pub dnssec_disabled: bool,
}

impl Default for Options {
Expand All @@ -99,6 +100,7 @@ impl Default for Options {
cache_size: 1024,
timeout: Duration::from_secs(3),
tls_name: "cloudflare-dns.com".into(),
dnssec_disabled: false,
}
}
}
Expand Down Expand Up @@ -144,6 +146,10 @@ pub struct DnsCli {
/// Default is to look up IPv4 and IPv6 in parallel.
#[clap(env, long, default_value = "ipv4_and_ipv6")]
pub dns_lookup_strategy: LookupStrategy,

/// Disable DNSSEC validation for DNS queries (DNSSEC is enabled by default)
#[clap(env, long)]
pub dns_dnssec_disabled: bool,
}

impl From<&DnsCli> for Options {
Expand All @@ -155,6 +161,7 @@ impl From<&DnsCli> for Options {
cache_size: c.dns_cache_size,
timeout: c.dns_timeout,
tls_name: c.dns_tls_name.clone(),
dnssec_disabled: c.dns_dnssec_disabled,
}
}
}
1 change: 1 addition & 0 deletions ic-bn-lib/src/http/dns/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ impl Resolver {
opts.ip_strategy = o.lookup_ip_strategy;
opts.use_hosts_file = ResolveHosts::Never;
opts.preserve_intermediates = false;
opts.validate = !o.dnssec_disabled;
opts.try_tcp_on_error = true;

let builder = TokioResolver::builder_with_config(cfg, TokioConnectionProvider::default())
Expand Down