plugin/template: add upstream option (#1529)

* add upstream

* docs

* tests
This commit is contained in:
Chris O'Haver
2018-02-16 03:45:25 -05:00
committed by Miek Gieben
parent ba573c0f40
commit 2cad04ec10
4 changed files with 33 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ template CLASS TYPE [ZONE...] {
[authority RR]
[...]
[rcode CODE]
[upstream [ADDRESS...]]
[fallthrough [ZONE...]]
}
~~~
@@ -29,6 +30,9 @@ template CLASS TYPE [ZONE...] {
* `answer|additional|authority` **RR** A [RFC 1035](https://tools.ietf.org/html/rfc1035#section-5) style resource record fragment
built by a [Go template](https://golang.org/pkg/text/template/) that contains the reply.
* `rcode` **CODE** A response code (`NXDOMAIN, SERVFAIL, ...`). The default is `SUCCESS`.
* `upstream` [**ADDRESS**...] defines the upstream resolvers used for resolving CNAME.
If no **ADDRESS** is given, CoreDNS will resolve CNAMEs against itself. **ADDRESS**
can be an IP, an IP:port, or a path to a file structured like resolv.conf.
* `fallthrough` Continue with the next plugin if the zone matched but no regex matched.
If specific zones are listed (for example `in-addr.arpa` and `ip6.arpa`), then only queries for
those zones will be subject to fallthrough.