From 2aa6baaa57cd124b3c88760c14003d5b6828c49d Mon Sep 17 00:00:00 2001 From: Slatian Date: Mon, 7 Aug 2023 21:52:31 +0200 Subject: [PATCH] Removed dns search functionality completely I don't see it working and not being annoying --- Configuration.md | 6 ------ echoip_test.toml | 3 --- src/config/dns.rs | 8 +------- src/main.rs | 2 +- 4 files changed, 2 insertions(+), 17 deletions(-) diff --git a/Configuration.md b/Configuration.md index ac83b18..0639e19 100644 --- a/Configuration.md +++ b/Configuration.md @@ -90,12 +90,6 @@ In case you want to use the system resolver and customize it. `system_resolver_weight` : Equivalent to the `weight` of a custom resolver, default: 1000 -### `search` - -This is for a work in progress feature that allows confiuring search domains for all custom dns resolvers. - -Note: it is currently disabled as it was causing problems. - ### Custom resolvers It is possible to confgure custom resolvers in plce of or in addition to the default system resolver. diff --git a/echoip_test.toml b/echoip_test.toml index c9121a7..6ea1088 100644 --- a/echoip_test.toml +++ b/echoip_test.toml @@ -28,9 +28,6 @@ allow_reverse_lookup = true # that end with one of these suffixes don't exist hidden_suffixes = [".com"] -# doesn't really work 🙁 -search = ["org","net"] - [geoip] # Path to geoip databses # Currently only the mmdb format is supported diff --git a/src/config/dns.rs b/src/config/dns.rs index 1d1d247..6db438b 100644 --- a/src/config/dns.rs +++ b/src/config/dns.rs @@ -1,6 +1,5 @@ use serde::{Deserialize,Serialize}; use trust_dns_resolver::config::Protocol; -use trust_dns_resolver::Name; use std::collections::HashMap; use std::net::SocketAddr; @@ -11,7 +10,6 @@ pub struct DnsConfig { pub allow_forward_lookup: bool, pub allow_reverse_lookup: bool, pub hidden_suffixes: Vec, - pub search: Vec, pub resolver: HashMap, pub enable_system_resolver: bool, @@ -40,8 +38,6 @@ pub struct DnsResolverConfig { #[serde(default="zero")] pub weight: i32, pub servers: Vec, - #[serde(default)] - pub search: Vec, pub protocol: DnsProtocol, pub tls_dns_name: Option, #[serde(skip_serializing)] //Don't leak our bind address to the outside @@ -65,7 +61,6 @@ impl Default for DnsConfig { allow_reverse_lookup: false, hidden_suffixes: Vec::new(), resolver: Default::default(), - search: Vec::new(), enable_system_resolver: true, system_resolver_name: "System".to_string(), @@ -89,8 +84,7 @@ impl Into for DnsProtocol { impl DnsResolverConfig { pub fn to_trust_resolver_config( - &self, - additional_search: &Vec, + &self ) -> trust_dns_resolver::config::ResolverConfig { let mut resolver = trust_dns_resolver::config::ResolverConfig::new(); for server in &self.servers { diff --git a/src/main.rs b/src/main.rs index 4f9f01d..5163fb4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -259,7 +259,7 @@ async fn main() { for (key, resolver_config) in &config.dns.resolver { println!("Initalizing {} resolver ...", key); let resolver = TokioAsyncResolver::tokio( - resolver_config.to_trust_resolver_config(&config.dns.search), + resolver_config.to_trust_resolver_config(), Default::default() ).unwrap(); dns_resolver_map.insert(key.clone(), resolver);