aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2019-01-03 20:47:28 +0100
committerGravatar Yong Tang <yong.tang.github@outlook.com> 2019-01-04 03:47:28 +0800
commit5e4faf9bb5db8218ac5a3f4f11f75abbbd91f7e8 (patch)
tree1178b7f1a8021d73f931e955bc121711e38336af
parent7642995558c9dcd0454c358a3688ac08a1ebfb7c (diff)
downloadcoredns-5e4faf9bb5db8218ac5a3f4f11f75abbbd91f7e8.tar.gz
coredns-5e4faf9bb5db8218ac5a3f4f11f75abbbd91f7e8.tar.zst
coredns-5e4faf9bb5db8218ac5a3f4f11f75abbbd91f7e8.zip
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>
-rw-r--r--corefile.5.md26
1 files changed, 22 insertions, 4 deletions
diff --git a/corefile.5.md b/corefile.5.md
index dc8132822..663b61e0a 100644
--- a/corefile.5.md
+++ b/corefile.5.md
@@ -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
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.
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}`
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:
-~~~ Corefile
+~~~ corefile
. {
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
The **ZONE** is root zone `.`, the **PLUGIN** is chaos. The chaos plugin takes an argument: