Quad9 dns instead of system dns

This commit is contained in:
Daniel Karzel 2021-04-19 17:34:14 +10:00
parent 56a23fa98f
commit 08c5d1c12e
No known key found for this signature in database
GPG Key ID: 30C3FC2E438ADB6E
3 changed files with 5 additions and 1 deletions

1
Cargo.lock generated
View File

@ -3699,6 +3699,7 @@ dependencies = [
"tracing-appender", "tracing-appender",
"tracing-futures", "tracing-futures",
"tracing-subscriber", "tracing-subscriber",
"trust-dns-resolver",
"url 2.2.1", "url 2.2.1",
"uuid", "uuid",
"void", "void",

View File

@ -56,6 +56,7 @@ tracing = { version = "0.1", features = ["attributes"] }
tracing-appender = "0.1" tracing-appender = "0.1"
tracing-futures = { version = "0.2", features = ["std-future", "futures-03"] } 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"] } 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"] } url = { version = "2", features = ["serde"] }
uuid = { version = "0.8", features = ["serde", "v4"] } uuid = { version = "0.8", features = ["serde", "v4"] }
void = "1" void = "1"

View File

@ -23,7 +23,9 @@ pub fn build(id_keys: &identity::Keypair) -> Result<SwapTransport> {
let noise = NoiseConfig::xx(dh_keys).into_authenticated(); let noise = NoiseConfig::xx(dh_keys).into_authenticated();
let tcp = TokioTcpConfig::new().nodelay(true); 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 websocket = WsConfig::new(dns.clone());
let transport = websocket let transport = websocket