From d2c47ba5237e07f091c4b19313db7159cb216bac Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Thu, 15 Dec 2022 00:00:05 +0700 Subject: [PATCH] docs: add documentation for failover rcode --- docs/config.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/config.md b/docs/config.md index 3b24144..44c125e 100644 --- a/docs/config.md +++ b/docs/config.md @@ -300,4 +300,21 @@ Above policy will: - type: array of rule +### failover_rcodes +For non success response, `failover_rcodes` allows the request to be forwarded to next upstream, if the response `RCODE` matches any value defined in `failover_rcodes`. For example: + +```toml +[listener.0.policy] +name = "My Policy" +failover_rcodes = ["NXDOMAIN", "SERVFAIL"] +networks = [ + {"network.0" = ["upstream.0", "upstream.1"]}, +] +``` + +If `upstream.0` returns a NXDOMAIN response, the request will be forwarded to `upstream.1` instead of returning immediately to the client. + +See all available DNS Rcodes value [here](rcode_link). + [toml_link]: https://toml.io/en +[rcode_link]: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6