feat(resolver): Enable DNSSEC (#94)

From hickory-resolver docs:
> To enable DNSSEC, enable the dnssec-ring feature.

Related: https://github.com/chatmail/relay/issues/877
Related: https://github.com/hickory-dns/hickory-dns/issues/3519
Closes: https://github.com/chatmail/filtermail/issues/93

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
This commit is contained in:
Jagoda Estera Ślązak
2026-08-18 12:21:28 +02:00
committed by missytake
parent 79e1d78e5b
commit af581d558f
3 changed files with 64 additions and 2 deletions
+11 -1
View File
@@ -40,7 +40,17 @@ impl CachedResolver {
/// Creates a new [`CachedResolver`].
pub fn new() -> Result<Self, crate::error::Error> {
// Use resolv.conf
let dns_resolver = TokioResolver::builder(TokioConnectionProvider::default())?.build();
let dns_resolver = {
let mut builder = TokioResolver::builder(TokioConnectionProvider::default())?;
// https://github.com/hickory-dns/hickory-dns/issues/3519
builder.options_mut().validate = true;
builder.build()
};
assert!(
dns_resolver.options().validate,
"incorrect resolver config: DNSSEC disabled; exiting"
);
let cache = Arc::new(parking_lot::Mutex::new(LruCache::new(LRU_CACHE_CAPACITY)));