plugin/rewrite: tweak parse error messaging, add tests (#1737)

* tweak parse error messaging, add tests

* looser err msg checking
This commit is contained in:
Chris O'Haver
2018-04-25 15:48:32 -04:00
committed by Miek Gieben
parent 9e8893a0b5
commit 5e06687ee5
4 changed files with 63 additions and 3 deletions

View File

@@ -155,7 +155,7 @@ ftp-us-west-1.coredns.rocks. 0 IN A 10.20.20.20
ftp-us-west-1.coredns.rocks. 0 IN A 10.30.30.30
```
The syntax for the response of DNS request and response is as follows:
The syntax for the rewrite of DNS request and response is as follows:
```
rewrite [continue|stop] {
@@ -164,6 +164,19 @@ rewrite [continue|stop] {
}
```
Note that the above syntax is strict. For response rewrites only `name`
rules are allowed to match the question section, and only by match type
`regex`. The answer rewrite must be after the name, as ordered in the
syntax example. There must only be two lines (a `name` follwed by an
`answer`) in the brackets, additional rules are not supported.
An alternate syntax for the rewrite of DNS request and response is as
follows:
```
rewrite [continue|stop] name regex STRING STRING answer name STRING STRING
```
## EDNS0 Options
Using FIELD edns0, you can set, append, or replace specific EDNS0 options on the request.