2929//! `/dns6/...` and `/dnsaddr/...` components of the given `Multiaddr` through
3030//! a DNS, replacing them with the resolved protocols (typically TCP/IP).
3131//!
32- //! The `tokio` feature and hence the [`tokio::Transport`] are enabled by default.
32+ //! The [`tokio::Transport`] is enabled by default under the `tokio` feature .
3333//! Tokio users can furthermore opt-in to the `tokio-dns-over-rustls` and
3434//! `tokio-dns-over-https-rustls` features.
3535//! For more information about these features, please refer to the documentation
5959pub mod tokio {
6060 use std:: sync:: Arc ;
6161
62- use hickory_resolver:: { system_conf, TokioResolver } ;
62+ use hickory_resolver:: { name_server :: TokioConnectionProvider , system_conf, TokioResolver } ;
6363 use parking_lot:: Mutex ;
6464
6565 /// A `Transport` wrapper for performing DNS lookups when dialing `Multiaddr`esses
@@ -82,7 +82,12 @@ pub mod tokio {
8282 ) -> Transport < T > {
8383 Transport {
8484 inner : Arc :: new ( Mutex :: new ( inner) ) ,
85- resolver : TokioResolver :: tokio ( cfg, opts) ,
85+ resolver : TokioResolver :: builder_with_config (
86+ cfg,
87+ TokioConnectionProvider :: default ( ) ,
88+ )
89+ . with_options ( opts)
90+ . build ( ) ,
8691 }
8792 }
8893 }
@@ -579,8 +584,6 @@ mod tests {
579584
580585 use super :: * ;
581586
582- // These helpers will be compiled conditionally, depending on the async runtime in use.
583-
584587 fn test_tokio < T , F : Future < Output = ( ) > > (
585588 transport : T ,
586589 test_fn : impl FnOnce ( tokio:: Transport < T > ) -> F ,
0 commit comments