plugin/rewrite: add rcode as a rewrite option (#6204)

* plugin/forward add ignore_server_failure for masking upstream server faults

Signed-off-by: schou <pschou@users.noreply.github.com>

* Switch from a ignore_server_fail to a rewrite rcode type.

Signed-off-by: schou <pschou@users.noreply.github.com>

* trim down the tests

Signed-off-by: schou <pschou@users.noreply.github.com>

* fixing readme TTL and using map for rcode

Signed-off-by: schou <pschou@users.noreply.github.com>

* add newline

Signed-off-by: schou <pschou@users.noreply.github.com>

---------

Signed-off-by: schou <pschou@users.noreply.github.com>
This commit is contained in:
pschou 2023-08-26 22:20:12 -04:00 committed by GitHub
parent 07c7dc82f0
commit 5ace19d455
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 308 additions and 0 deletions

View file

@ -141,6 +141,8 @@ func newRule(args ...string) (Rule, error) {
return newTTLRule(mode, args[startArg:]...)
case "cname":
return newCNAMERule(mode, args[startArg:]...)
case "rcode":
return newRCodeRule(mode, args[startArg:]...)
default:
return nil, fmt.Errorf("invalid rule type %q", args[0])
}