chore(docs): regenerate man pages (#7971)

This commit is contained in:
Ville Vesilehto
2026-03-27 05:35:09 +02:00
committed by GitHub
parent 49b18b8af6
commit 0132ad86b5
60 changed files with 2110 additions and 280 deletions

View File

@@ -1,5 +1,5 @@
.\" Generated by Mmark Markdown Processer - mmark.miek.nl
.TH "COREDNS-TEMPLATE" 7 "March 2021" "CoreDNS" "CoreDNS Plugins"
.TH "COREDNS-TEMPLATE" 7 "March 2026" "CoreDNS" "CoreDNS Plugins"
.SH "NAME"
.PP
@@ -20,7 +20,8 @@ template CLASS TYPE [ZONE...] {
additional RR
authority RR
rcode CODE
fallthrough [ZONE...]
ederror EXTENDED\_ERROR\_CODE [EXTRA\_REASON]
fallthrough [FALLTHROUGH\-ZONE...]
}
.fi
@@ -33,24 +34,29 @@ template CLASS TYPE [ZONE...] {
.IP \(bu 4
\fBZONE\fP the zone scope(s) for this template. Defaults to the server zones.
.IP \(bu 4
\fBREGEX\fP Go regexp
\[la]https://golang.org/pkg/regexp/\[ra] that are matched against the incoming question name. Specifying no regex matches everything (default: \fB\fC.*\fR). First matching regex wins.
\fB\fCmatch\fR \fBREGEX\fP Go regexp
\[la]https://golang.org/pkg/regexp/\[ra] that are matched against the incoming question name.
Specifying no regex matches everything (default: \fB\fC.*\fR). First matching regex wins. Regex patterns
must not exceed 10000 characters.
.IP \(bu 4
\fB\fCanswer|additional|authority\fR \fBRR\fP A RFC 1035
\[la]https://tools.ietf.org/html/rfc1035#section-5\[ra] style resource record fragment
built by a Go template
\[la]https://golang.org/pkg/text/template/\[ra] that contains the reply.
\[la]https://golang.org/pkg/text/template/\[ra] that contains the reply. Specifying no answer will result
in a response with an empty answer section.
.IP \(bu 4
\fB\fCrcode\fR \fBCODE\fP A response code (\fB\fCNXDOMAIN, SERVFAIL, ...\fR). The default is \fB\fCSUCCESS\fR.
\fB\fCrcode\fR \fBCODE\fP A response code (\fB\fCNXDOMAIN, SERVFAIL, ...\fR). The default is \fB\fCNOERROR\fR. Valid response code values are
per the \fB\fCRcodeToString\fR map defined by the \fB\fCmiekg/dns\fR package in \fB\fCmsg.go\fR.
.IP \(bu 4
\fB\fCfallthrough\fR Continue with the next plugin if the zone matched but no regex matched.
If specific zones are listed (for example \fB\fCin-addr.arpa\fR and \fB\fCip6.arpa\fR), then only queries for
those zones will be subject to fallthrough.
\fB\fCederror\fR \fBEXTENDED\fIERROR\fPCODE\fP is an extended DNS error code as a number defined in \fB\fCRFC8914\fR (0, 1, 2,..., 24).
\fBEXTRA_REASON\fP is an additional string explaining the reason for returning the error.
.IP \(bu 4
\fB\fCfallthrough\fR Continue with the next \fItemplate\fP instance if the \fItemplate\fP's \fBZONE\fP matches a query name but no regex match.
If there is no next \fItemplate\fP, continue resolution with the next plugin. If \fB[FALLTHROUGH-ZONE...]\fP are listed (for example
\fB\fCin-addr.arpa\fR and \fB\fCip6.arpa\fR), then only queries for those zones will be subject to fallthrough. Without
\fB\fCfallthrough\fR, when the \fItemplate\fP's \fBZONE\fP matches a query but no regex match then a \fB\fCSERVFAIL\fR response is returned.
.PP
At least one \fB\fCanswer\fR or \fB\fCrcode\fR directive is needed (e.g. \fB\fCrcode NXDOMAIN\fR).
.PP
Also see
\[la]#also-see\[ra] contains an additional reading list.
@@ -83,6 +89,15 @@ Each resource record is a full-featured Go template
metadata plugin is enabled. For example, \fB\fC.Meta "kubernetes/client-namespace"\fR
.PP
and the following predefined template functions
\[la]https://golang.org/pkg/text/template#hdr-Functions\[ra]
.IP \(bu 4
\fB\fCparseInt\fR interprets a string in the given base and bit size. Equivalent to strconv.ParseUint
\[la]https://golang.org/pkg/strconv#ParseUint\[ra].
.PP
The output of the template must be a RFC 1035
\[la]https://tools.ietf.org/html/rfc1035\[ra] style resource record (commonly referred to as a "zone file").
@@ -98,11 +113,11 @@ The output of the template must be a RFC 1035
If monitoring is enabled (via the \fIprometheus\fP plugin) then the following metrics are exported:
.IP \(bu 4
\fB\fCcoredns_template_matches_total{server, regex}\fR the total number of matched requests by regex.
\fB\fCcoredns_template_matches_total{server, zone, view, class, type}\fR the total number of matched requests by regex.
.IP \(bu 4
\fB\fCcoredns_template_template_failures_total{server, regex,section,template}\fR the number of times the Go templating failed. Regex, section and template label values can be used to map the error back to the config file.
\fB\fCcoredns_template_template_failures_total{server, zone, view, class, type, section, template}\fR the number of times the Go templating failed. Regex, section and template label values can be used to map the error back to the config file.
.IP \(bu 4
\fB\fCcoredns_template_rr_failures_total{server, regex,section,template}\fR the number of times the templated resource record was invalid and could not be parsed. Regex, section and template label values can be used to map the error back to the config file.
\fB\fCcoredns_template_rr_failures_total{server, zone, view, class, type, section, template}\fR the number of times the templated resource record was invalid and could not be parsed. Regex, section and template label values can be used to map the error back to the config file.
.PP
@@ -150,6 +165,7 @@ The \fB\fC.invalid\fR domain is a reserved TLD (see RFC 2606 Reserved Top Level
template ANY ANY invalid {
rcode NXDOMAIN
authority "invalid. 60 {{ .Class }} SOA ns.invalid. hostmaster.invalid. (1 60 60 60 60)"
ederror 21 "Blocked according to RFC2606"
}
}
@@ -254,6 +270,28 @@ Having templates to map certain PTR/A pairs is a common pattern.
.PP
Fallthrough is needed for mixed domains where only some responses are templated.
.SS "RESOLVE HEXADECIMAL IP PATTERN USING PARSEINT"
.PP
.RS
.nf
\&. {
forward . 8.8.8.8
template IN A example {
match "^ip0a(?P<b>[a\-f0\-9]{2})(?P<c>[a\-f0\-9]{2})(?P<d>[a\-f0\-9]{2})[.]example[.]$"
answer "{{ .Name }} 60 IN A 10.{{ parseInt .Group.b 16 8 }}.{{ parseInt .Group.c 16 8 }}.{{ parseInt .Group.d 16 8 }}"
fallthrough
}
}
.fi
.RE
.PP
An IPv4 address can be expressed in a more compact form using its hexadecimal encoding.
For example \fB\fCip-10-123-123.example.\fR can instead be expressed as \fB\fCip0a7b7b7b.example.\fR
.SS "RESOLVE MULTIPLE IP PATTERNS"
.PP
.RS
@@ -332,6 +370,27 @@ Named capture groups can be used to template one response for multiple patterns.
.fi
.RE
.SS "FABRICATE A CNAME"
.PP
This example responds with a CNAME to \fB\fCgoogle.com\fR for any DNS query made exactly for \fB\fCfoogle.com\fR.
The answer will also contain a record for \fB\fCgoogle.com\fR if the upstream nameserver can return a record for it of the
requested type.
.PP
.RS
.nf
\&. {
template IN ANY foogle.com {
match "^foogle\\.com\\.$"
answer "foogle.com 60 IN CNAME google.com"
}
forward . 8.8.8.8
}
.fi
.RE
.SH "ALSO SEE"
.IP \(bu 4
Go regexp