From e248e7513b030b3d960bd08255a70ee6ed004887 Mon Sep 17 00:00:00 2001 From: Erdem MEYDANLI Date: Thu, 30 May 2024 13:25:24 +0000 Subject: [PATCH] vsock_proxy: Use system-configured nameservers for DNS resolution This commit changes the DNS resolver's initialization to use the system's configured nameservers instead of the default nameserver provided by hickoery-resolver crate. The `Resolver::from_system_conf()` method is now used to initialize the DNS resolver. This method attempts to read the system's nameserver configuration, which may come from various sources such as `/etc/resolv.conf`. Signed-off-by: Erdem MEYDANLI --- vsock_proxy/src/dns.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vsock_proxy/src/dns.rs b/vsock_proxy/src/dns.rs index 3945bd1a..915da9f1 100644 --- a/vsock_proxy/src/dns.rs +++ b/vsock_proxy/src/dns.rs @@ -6,7 +6,6 @@ use std::net::IpAddr; use chrono::{DateTime, Duration, Utc}; -use hickory_resolver::config::*; use hickory_resolver::Resolver; use idna::domain_to_ascii; @@ -51,11 +50,12 @@ pub fn resolve(addr: &str, ip_addr_type: IpAddrType) -> VsockProxyResult = resolver .lookup_ip(addr) .map_err(|_| "DNS lookup failed!")?