fix(dnsserver): allow view server blocks in any declaration order (#8001)

When using the view plugin, filtered and unfiltered server blocks can
share the same zone and port. The zone overlap validation rejected this
configuration when the unfiltered block was not declared last, because
filtered configs treated an already-registered zone as an error.

Skip the 'already defined' check for configs that have filter functions,
since they are expected to coexist with an unfiltered catch-all block on
the same zone/port.

Fixes #7733

Signed-off-by: umut-polat <52835619+umut-polat@users.noreply.github.com>
This commit is contained in:
Umut Polat
2026-04-04 20:45:55 +03:00
committed by GitHub
parent 4eb6eca9f0
commit 2263340fab
3 changed files with 146 additions and 4 deletions

View File

@@ -25,6 +25,15 @@ view NAME {
For expression syntax and examples, see the Expressions and Examples sections.
## Server Block Ordering
Server blocks sharing the same zone and port are evaluated **top to bottom**. The first block whose
view expression matches (or that has no view) handles the query. An unfiltered catch-all block
declared *before* a filtered block will shadow it, because the catch-all matches every query.
To get the expected split-DNS behavior, declare all filtered (view) blocks first and the unfiltered
catch-all block last.
## Examples
Implement CIDR based split DNS routing. This will return a different