hickory-dns / resolv-conf

The /etc/resolv.conf file parser in rust
Apache License 2.0
27 stars 25 forks source link

"trust-ad" in /etc/resolv.conf causes error on Ubuntu 20.04.1 #25

Closed rich-murphey closed 4 years ago

rich-murphey commented 4 years ago

On a up-to-date Ubuntu 20.04.1 LTS, I'm seeing an issue when /etc/resolv.conf contains the option "trust-ad":

nameserver 127.0.0.53
options edns0 trust-ad
search lan

And removing the word "trust-ad" from /etc/resolv.conf fixes the issue -- no error occurs when "trust-ad" is missing.

I'm seeing this when using drill, which uses reqwest, which uses resolv-conf, as follows:

drill --no-check-certificate --benchmark load/dev.yml --stats -q
Concurrency 256
Iterations 1024
Rampup 0
Base URL https://foo.internal.net:28080

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Builder, source: Custom { kind: Other, error: "error reading DNS system conf: Error parsing resolv.conf: InvalidOption(17)" } }', /g/rich/.cargo/registry/src/github.com-1ecc6299db9ec823/drill-0.7.0/src/actions/request.rs:151:58

Sorry for not submitting a PR. I'd be glad to if needed.

tailhook commented 4 years ago

This is fixed in v0.7.0 version of the library. Generally we should probably make it more easily upgradable (Currently every new option requires major version bump). But in the meantime it looks like trust-dns-resolver updated their dependency, so probably it should work already.