File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ use crate::resolver_cache::ResolverCache;
22
22
use std:: net:: IpAddr ;
23
23
use std:: time:: SystemTime ;
24
24
use std:: sync:: { Arc , Mutex } ;
25
- use std:: vec;
25
+ use std:: { env , vec} ;
26
26
/// Asynchronous resolver for DNS queries.
27
27
///
28
28
/// This struct contains a cache and a configuration for the resolver.
@@ -479,6 +479,17 @@ impl AsyncResolver {
479
479
_ => Err ( ClientError :: ResponseError ( rcode. into ( ) ) ) ?,
480
480
}
481
481
}
482
+
483
+ fn from_os ( ) -> Self {
484
+ let os = env:: consts:: OS ;
485
+ match os {
486
+ "linux" | "windows" => {
487
+ let conf = ResolverConfig :: os_config ( ) ;
488
+ AsyncResolver :: new ( conf)
489
+ } ,
490
+ _ => { panic ! ( "Unsupported operating system: {}. Please use either 'linux' or 'windows'." , os) } ,
491
+ }
492
+ }
482
493
}
483
494
484
495
// Getters
You can’t perform that action at this time.
0 commit comments