Currently, if queries to name servers over UDP result in either a
truncated response, or any kind of error, the query will be retried over
TCP. It should be possible to only use TCP for the case of oversized
messages, and avoid it in the common case. This change makes this the
default behavior and adds an option to ResolverOpts that can be enabled
to get the current behavior.
Some servers do not support EDNS, and some (such as the ingress-dns
addon to Minikube) return malformed DNS responses when sent EDNS
additional records. Previously, it was not possible to not send the
EDNS records, despite having a ResolverOpts field for it, which was
confusing.
This commit wires the ResolverOpts edns0 option to a new
DnsRequestOptions field and uses that option to control whether or not
additional EDNS records should be used.
Note: this changes the default behavior of the resolver, as the default
value for ResolverOpts::edns0 is false, but previously the additional
EDNS records would be added anyway. It seems this change is inline with
the desired behavior, as the defaults are intended to match the
resolv.conf defaults, which do not use EDNS.
Signed-off-by: Zvi "CtrlZvi" Effron <viz_skywalker+GitHub@outlook.com>
* add more debug information to DNSSEC validation
* update ring validation to allow 1024bit keys for all Algorithm types
* disable dnssec tests in std builds
* ensure TrustAnchor is constructed properly in DnsSecSyncClient
* add key length to DNSKEY display
* logger: missing https crate
* https: use RuntimeProvider when making connections
- [X] use RuntimeProvider when making TCP connections
- [ ] use RuntimeProvider when making TLS upgrades
- [ ] migrate tests
* RuntimeProvider::Tcp: remove async read/write
The TCP needs to Connect, the async readwriter will be in the
transport of connect. Thus we don't need it to be a requirement
on the top trait of RuntimeProvider
* AsyncResolver: remove async from new()
Related to overriding RuntimeProvider for #1074
Solves #1056
* cleanup tests
* rebase master for 0.19.5
* fix windows tests
Co-authored-by: Benjamin Fry <benjaminfry@me.com>
* Allow CNAME records on A/AAAA lookups
Fixes#184
* rustfmt
* Fix cname chain min TTL test
The test assumed that the CNAME record wouldn't be returned.
Now we only check that the A record TTLs were changed
* Fix lookup integration tests & max query depth
- include cname record in test
- move max query depth check
* add preserve_intermediates option
* preserve records across queries
* add as_lookup to LookupIp
Co-authored-by: Johnny Bergström <github@joonix.se>
* [trust-dns-resolver] refactor tests
* [trust-dns-resolver] refactor tests
This allows the unit tests defined in the async_resolver mod to be run
with different runtimes.
1. Create a trait RuntimeProvider to abstract the resolver
implementation.
2. Make TokioAsyncResolver as default type.
3. Keep the tls related codes unchanged, which may be abstracted at a
later point.
4. Update the other codes and test cases wherever necessary.
* all tests updated for new background
* background in Resolver now supported, wip
* clean up client impls
* client passing all tests
* cleanup review comments, remove try_locks
* remove mutexes on NameServers in NameServerPool
* refactored ConnectionProvider
* remove pinutils dependency
* remove the now unused custom *LookupFutures
* remove unused types
* remove all deprecated interfaces from Client
* rename ClientFuture to AsyncClient
* all clippy warnings and SecureClient working
* cleanup clippy warnnings
* Everything working with Background removed
* fix infinite loop
* Client refactored without background
* rebased onto tokio 0.2
* remove Clone and Option from background connects
* cleanup from review
* fix clippy warnings
* spawn in ConnectionProvider
* fix no-default-features test
* only expose testing functions during testing
* fix copyright typo
* revert lookup_ip interface change
* limit tokio features to least required set
* rename tokio-compat to tokio-runtime
* use async fns where possible on AsyncResolver
* fix lifetime issue