mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 00:04:15 -04:00
view: Add IPv6 example match (#7355)
Add an IPv6 source address matching example to the view plugin. Fixes: https://github.com/coredns/coredns/issues/7354 Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
@@ -31,6 +31,7 @@ Implement CIDR based split DNS routing. This will return a different
|
||||
answer for `test.` depending on client's IP address. It returns ...
|
||||
* `test. 3600 IN A 1.1.1.1`, for queries with a source address in 127.0.0.0/24
|
||||
* `test. 3600 IN A 2.2.2.2`, for queries with a source address in 192.168.0.0/16
|
||||
* `test. 3600 IN AAAA 2001:0DB8::1`, for queries with a source address in 2001:0DB8::/32
|
||||
* `test. 3600 IN A 3.3.3.3`, for all others
|
||||
|
||||
```
|
||||
@@ -52,6 +53,17 @@ answer for `test.` depending on client's IP address. It returns ...
|
||||
}
|
||||
}
|
||||
|
||||
. {
|
||||
view v6_example1 {
|
||||
expr incidr(client_ip(), '2001:0DB8::/32')
|
||||
}
|
||||
hosts {
|
||||
2001:0DB8::1 test
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
. {
|
||||
hosts {
|
||||
3.3.3.3 test
|
||||
|
||||
Reference in New Issue
Block a user