mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[PR #3298] [MERGED] Do not resolve private/reserved addresses on public zones #3720
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#3720
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hickory-dns/hickory-dns/pull/3298
Author: @marcus0x62
Created: 10/3/2025
Status: ✅ Merged
Merged: 10/10/2025
Merged by: @marcus0x62
Base:
main← Head:do-not-resolve📝 Commits (4)
3b05f42recursor: add generic AccessControlSet for name server filtering6b40df4recursor: add response IP address filteringebd4879combine bailiwick checking with answer filter024ab3bconformance: add e2e-test coverage for response answer filtering📊 Changes
10 files changed (+411 additions, -104 deletions)
View changed files
📝
conformance/e2e-tests/src/resolver.rs(+1 -0)➕
conformance/e2e-tests/src/resolver/do_not_answer.rs(+90 -0)➕
conformance/e2e-tests/src/resolver/do_not_answer.toml(+14 -0)📝
crates/recursor/src/lib.rs(+148 -1)📝
crates/recursor/src/metrics_tests.rs(+1 -1)📝
crates/recursor/src/recursor.rs(+54 -9)📝
crates/recursor/src/recursor_dns_handle.rs(+73 -71)📝
crates/recursor/src/recursor_pool.rs(+3 -22)📝
crates/server/src/store/recursor.rs(+17 -0)📝
tests/test-data/test_configs/example_recursor.toml(+10 -0)📄 Description
This PR introduces response address filtering (#347) for the recursor. The main intended use case is to filter out answers in public zones that contain private or reserved addresses.
I noticed while working on this PR that, for NS referral filtering configuration, we add whatever the user configures to the default lists. I think the approach used here is probably easier for people to reason about:
Of course, if people want to combine these, they can. For example:
allow_answers=["192.168.1.100/32"]
deny_answers=["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]
would block only the RFC-1918 address space, but allow answers from 192.168.1.100 to flow through.
Regardless, I think these two features -- NS referral filtering and answer filtering should have the some configuration logic, and if everyone agrees on the above approach, I'll add changes for that feature to match.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.