forked from coredns/coredns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcorefile.5
207 lines (155 loc) · 3.78 KB
/
corefile.5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
.\" Generated by Mmark Markdown Processer - mmark.miek.nl
.TH "COREFILE" 5 "March 2021" "CoreDNS" "CoreDNS"
.SH "NAME"
.PP
\fIcorefile\fP - configuration file for CoreDNS.
.SH "DESCRIPTION"
.PP
A \fIcorefile\fP specifies the internal servers CoreDNS should run and what plugins each of these
should chain. The syntax is as follows:
.PP
.RS
.nf
[SCHEME://]ZONE [[SCHEME://]ZONE]...[:PORT] {
[PLUGIN]...
}
.fi
.RE
.PP
The \fBZONE\fP defines for which name this server should be called, multiple zones are allowed and
should be \fIwhite space\fP separated. You can use a "reverse" syntax to specify a reverse zone (i.e.
ip6.arpa and in-addr.arpa), by using an IP address in the CIDR notation.
.PP
The optional \fBSCHEME\fP defaults to \fB\fCdns://\fR, but can also be \fB\fCtls://\fR (DNS over TLS), \fB\fCgrpc://\fR
(DNS over gRPC) or \fB\fChttps://\fR (DNS over HTTP/2).
.PP
The optional \fBPORT\fP controls on which port the server will bind, this default to 53. If you use
a port number here, you \fIcan't\fP override it with \fB\fC-dns.port\fR (coredns(1)), also see coredns-bind(7).
.PP
Specifying a \fBZONE\fP \fIand\fP \fBPORT\fP combination multiple times for \fIdifferent\fP servers will lead to
an error on startup.
.PP
When a query comes in, it is matched again all zones for all servers, the server with the longest
match on the query name will receive the query.
.PP
\fBPLUGIN\fP defines the plugin(s) we want to load into this server. This is optional as well, but as
server with no plugins will just return SERVFAIL for all queries. Each plugin can have a number of
properties than can have arguments, see the documentation for each plugin.
.PP
Comments are allowed and begin with an unquoted hash \fB\fC#\fR and continue to the end of the line.
Comments may be started anywhere on a line.
.PP
Environment variables are supported and either the Unix or Windows form may be used: \fB\fC{$ENV_VAR_1}\fR
or \fB\fC{%ENV_VAR_2%}\fR.
.PP
You can use the \fB\fCimport\fR "plugin" (See coredns-import(7)) to include parts of other files.
.PP
If CoreDNS can’t find a Corefile to load it loads the following builtin one:
.PP
.RS
.nf
\&. {
whoami
log
}
.fi
.RE
.SH "IMPORT"
.PP
You can use the \fB\fCimport\fR "plugin" to include parts of other files, see
https://coredns.io/plugins/import
\[la]https://coredns.io/plugins/import\[ra], and coredns-import(7).
.SH "SNIPPETS"
.PP
If you want to reuse a snippet you can define one with and then use it with \fIimport\fP.
.PP
.RS
.nf
(mysnippet) {
log
whoami
}
\&. {
import mysnippet
}
.fi
.RE
.SH "EXAMPLES"
.PP
The \fBZONE\fP is root zone \fB\fC.\fR, the \fBPLUGIN\fP is \fIchaos\fP. The \fIchaos\fP plugin takes an (optional) argument:
\fB\fCCoreDNS-001\fR. This text is returned on a CH class query: \fB\fCdig CH TXT version.bind @localhost\fR.
.PP
.RS
.nf
\&. {
chaos CoreDNS\-001
}
.fi
.RE
.PP
When defining a new zone, you either create a new server, or add it to an existing one. Here we
define one server that handles two zones; that potentially chain different plugins:
.PP
.RS
.nf
example.org {
whoami
}
org {
whoami
}
.fi
.RE
.PP
Is identical to:
.PP
.RS
.nf
example.org org {
whoami
}
.fi
.RE
.PP
Reverse zones can be specified as domain names:
.PP
.RS
.nf
0.0.10.in\-addr.arpa {
whoami
}
.fi
.RE
.PP
or by just using the CIDR notation:
.PP
.RS
.nf
10.0.0.0/24 {
whoami
}
.fi
.RE
.PP
This also works on a non octet boundary:
.PP
.RS
.nf
10.0.0.0/27 {
whoami
}
.fi
.RE
.SH "AUTHORS"
.PP
CoreDNS Authors.
.SH "COPYRIGHT"
.PP
Apache License 2.0
.SH "SEE ALSO"
.PP
The manual page for CoreDNS: coredns(1) and more documentation on https://coredns.io
\[la]https://coredns.io\[ra].
Also see the \fIimport\fP
\[la]https://coredns.io/plugins/import\[ra]'s documentation and all the manual pages
for the plugins.