diff --git a/Cargo.lock b/Cargo.lock index d3609319..fb02879f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3699,6 +3699,7 @@ dependencies = [ "tracing-appender", "tracing-futures", "tracing-subscriber", + "trust-dns-resolver", "url 2.2.1", "uuid", "void", diff --git a/swap/Cargo.toml b/swap/Cargo.toml index 7d5e4dc0..0037f0bf 100644 --- a/swap/Cargo.toml +++ b/swap/Cargo.toml @@ -56,6 +56,7 @@ tracing = { version = "0.1", features = ["attributes"] } tracing-appender = "0.1" tracing-futures = { version = "0.2", features = ["std-future", "futures-03"] } tracing-subscriber = { version = "0.2", default-features = false, features = ["fmt", "ansi", "env-filter", "chrono", "tracing-log"] } +trust-dns-resolver = "0.20" url = { version = "2", features = ["serde"] } uuid = { version = "0.8", features = ["serde", "v4"] } void = "1" diff --git a/swap/src/network/transport.rs b/swap/src/network/transport.rs index eec3dadb..58c9692d 100644 --- a/swap/src/network/transport.rs +++ b/swap/src/network/transport.rs @@ -23,7 +23,9 @@ pub fn build(id_keys: &identity::Keypair) -> Result { let noise = NoiseConfig::xx(dh_keys).into_authenticated(); let tcp = TokioTcpConfig::new().nodelay(true); - let dns = TokioDnsConfig::system(tcp)?; + let config = trust_dns_resolver::config::ResolverConfig::quad9(); + let opts = trust_dns_resolver::config::ResolverOpts::default(); + let dns = TokioDnsConfig::custom(tcp, config, opts)?; let websocket = WsConfig::new(dns.clone()); let transport = websocket