mirror of
https://github.com/coredns/coredns.git
synced 2026-04-05 03:35:33 -04:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user