fix: forwarding rules override special-use NXDOMAIN #95
Reference in New Issue
Block a user
Delete Branch "fix/forwarding-precedes-special-use"
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?
Summary
[[forwarding]]rules now take precedence over RFC 6303 special-use domain intercept — PTR queries for private ranges (e.g.168.192.in-addr.arpa) are forwarded to the configured upstream instead of returning local NXDOMAINresolve_queryreturns(BytePacketBuffer, QueryPath)so callers and tests can inspect the resolution path directlysrc/testutil.rs:test_ctx(),mock_upstream(),blackhole_upstream()— deduplicates ~120 lines of 30-fieldServerCtxconstruction acrossctx.rs,api.rs,dot.rsresolve_querytests covering every step: overrides, localhost, local zones, special-use, TLD proxy, blocklist, cache, forwarding (with mock upstream)Closes #94
Test plan
cargo test), fmt/clippy/audit cleanspecial_use_private_ptr_returns_nxdomain— private PTR without forwarding rule returns NXDOMAINforwarding_rule_overrides_special_use_domain— same PTR with forwarding rule reaches upstreampipeline_forwarding_returns_upstream_answer— forwarded response content (domain + IP) verified through mock[[forwarding]]withsuffix = ["168.192.in-addr.arpa"]and verifydrill -x 192.168.188.153returns the upstream answer