Skip to content

Commit

Permalink
expose security-aware setting in named.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
japaric authored and bluejekyll committed May 11, 2024
1 parent 36258a8 commit 97e1f43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/server/src/store/recursor/authority.rs
Expand Up @@ -73,9 +73,13 @@ impl RecursiveAuthority {
});
}

let recursor = Recursor::new()
let mut recursor = Recursor::new();
recursor
.ns_cache_size(config.ns_cache_size)
.record_cache_size(config.record_cache_size)
.record_cache_size(config.record_cache_size);
#[cfg(feature = "dnssec")]
recursor.security_aware(config.security_aware);
let recursor = recursor
.build(roots)
.map_err(|e| format!("failed to initialize recursor: {e}"))?;

Expand Down
6 changes: 6 additions & 0 deletions crates/server/src/store/recursor/config.rs
Expand Up @@ -24,6 +24,7 @@ use crate::resolver::Name;

/// Configuration for file based zones
#[derive(Clone, Deserialize, Eq, PartialEq, Debug)]
#[serde(deny_unknown_fields)]
pub struct RecursiveConfig {
/// File with roots, aka hints
pub roots: PathBuf,
Expand All @@ -35,6 +36,11 @@ pub struct RecursiveConfig {
/// Maximum DNS record cache size
#[serde(default = "record_cache_size_default")]
pub record_cache_size: usize,

/// Whether the recursor is security-aware (RFC4035 section 3.2)
#[cfg(feature = "dnssec")]
#[serde(default)]
pub security_aware: bool,
}

impl RecursiveConfig {
Expand Down

0 comments on commit 97e1f43

Please sign in to comment.