docs: more on imports and snippets (#2423)
Add some docs in the manual page. Problem here is that it is only in the manual page and we don't publish this particular one on coredns.io. Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
parent
7642995558
commit
5e4faf9bb5
1 changed files with 22 additions and 4 deletions
|
@ -23,7 +23,7 @@ The optional **SCHEME** defaults to `dns://`, but can also be `tls://` (DNS over
|
||||||
The optional **PORT** controls on which port the server will bind, this default to 53. If you use
|
The optional **PORT** controls on which port the server will bind, this default to 53. If you use
|
||||||
a port number here, you *can't* override it with `-dns.port` (coredns(1)).
|
a port number here, you *can't* override it with `-dns.port` (coredns(1)).
|
||||||
|
|
||||||
Specifying a **ZONE** *and* **PORT** combination multiple time for *different* servers will lead to
|
Specifying a **ZONE** *and* **PORT** combination multiple times for *different* servers will lead to
|
||||||
an error on startup.
|
an error on startup.
|
||||||
|
|
||||||
When a query comes in, it is matched again all zones for all servers, the server with the longest
|
When a query comes in, it is matched again all zones for all servers, the server with the longest
|
||||||
|
@ -39,16 +39,34 @@ Comments may be started anywhere on a line.
|
||||||
Environment variables are supported and either the Unix or Windows form may be used: `{$ENV_VAR_1}`
|
Environment variables are supported and either the Unix or Windows form may be used: `{$ENV_VAR_1}`
|
||||||
or `{%ENV_VAR_2%}`.
|
or `{%ENV_VAR_2%}`.
|
||||||
|
|
||||||
You can use the `import` "plugin" to include parts of other files, see <https://coredns.io/explugins/import>.
|
|
||||||
|
|
||||||
If CoreDNS can’t find a Corefile to load it loads the following builtin one:
|
If CoreDNS can’t find a Corefile to load it loads the following builtin one:
|
||||||
|
|
||||||
~~~ Corefile
|
~~~ corefile
|
||||||
. {
|
. {
|
||||||
whoami
|
whoami
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
## Import
|
||||||
|
|
||||||
|
You can use the `import` "plugin" to include parts of other files, see <https://coredns.io/explugins/import>.
|
||||||
|
This is enabled by default.
|
||||||
|
|
||||||
|
## Snippets
|
||||||
|
|
||||||
|
If you want to reuse a snippet you can define one with and then use it with *import*.
|
||||||
|
|
||||||
|
~~~ corefile {
|
||||||
|
(mysnippet) {
|
||||||
|
log
|
||||||
|
whoami
|
||||||
|
}
|
||||||
|
|
||||||
|
. {
|
||||||
|
import mysnippet
|
||||||
|
}
|
||||||
|
~~~
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
The **ZONE** is root zone `.`, the **PLUGIN** is chaos. The chaos plugin takes an argument:
|
The **ZONE** is root zone `.`, the **PLUGIN** is chaos. The chaos plugin takes an argument:
|
||||||
|
|
Loading…
Add table
Reference in a new issue