Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing of /etc/resolv.conf by manually updating resolv-conf crate #184

Merged
merged 2 commits into from
Sep 11, 2020
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
33 changes: 16 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ tokio = { version = "0.2", features = ["rt-core", "sync"] }
trust-dns-resolver = "0.18.1"
async-trait = "0.1.21"
unicode-width = "0.1.8"
resolv-conf = "0.6.3"

[target.'cfg(target_os="windows")'.dependencies]
netstat2 = "0.9.0"
Expand All @@ -51,3 +52,6 @@ regex = "1"
[target.'cfg(target_os="windows")'.build-dependencies]
http_req = "0.7.0"
zip = "0.5.6"

[patch.crates-io]
resolv-conf = { git = 'https://github.com/tailhook/resolv-conf', rev = '83c0f25ebcb0615550488692c5213ca1ae4acd8f' }
5 changes: 4 additions & 1 deletion src/os/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,10 @@ pub fn get_input(
let mut runtime = Runtime::new()?;
let resolver = match runtime.block_on(dns::Resolver::new(runtime.handle().clone())) {
Ok(resolver) => resolver,
Err(_) => failure::bail!("Could not initialize the DNS resolver. Are you offline?"),
Err(err) => failure::bail!(
"Could not initialize the DNS resolver. Are you offline?\n\nReason: {:?}",
err
),
};
let dns_client = dns::Client::new(resolver, runtime)?;
Some(dns_client)
Expand Down