add query_all_nameservers config option
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
cb12f285e9
commit
3d0f0cc1ce
4 changed files with 29 additions and 1 deletions
|
@ -235,6 +235,8 @@ impl Service<'_> {
|
|||
|
||||
pub fn dns_resolver(&self) -> &TokioAsyncResolver { &self.resolver.resolver }
|
||||
|
||||
pub fn query_all_nameservers(&self) -> bool { self.config.query_all_nameservers }
|
||||
|
||||
pub fn actual_destinations(&self) -> &Arc<RwLock<resolver::WellKnownMap>> { &self.resolver.destinations }
|
||||
|
||||
pub fn jwt_decoding_key(&self) -> Option<&jsonwebtoken::DecodingKey> { self.jwt_decoding_key.as_ref() }
|
||||
|
|
|
@ -40,9 +40,22 @@ impl Resolver {
|
|||
.unwrap();
|
||||
|
||||
let mut conf = hickory_resolver::config::ResolverConfig::new();
|
||||
|
||||
if let Some(domain) = sys_conf.domain() {
|
||||
conf.set_domain(domain.clone());
|
||||
}
|
||||
|
||||
for sys_conf in sys_conf.search() {
|
||||
conf.add_search(sys_conf.clone());
|
||||
}
|
||||
|
||||
for sys_conf in sys_conf.name_servers() {
|
||||
let mut ns = sys_conf.clone();
|
||||
ns.trust_negative_responses = true;
|
||||
|
||||
if config.query_all_nameservers {
|
||||
ns.trust_negative_responses = true;
|
||||
}
|
||||
|
||||
conf.add_name_server(ns);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue