mirror of
https://github.com/coredns/coredns.git
synced 2026-10-08 19:45:21 -04:00
docs(corefile): document that the Corefile is line oriented (#8544)
The Caddyfile parser in coredns/caddy reads the arguments of a plugin, or of one of its properties, up to the end of the line, and a closing brace on that line can be read as one of them. corefile.5.md never said so, and a one-line server block such as '. { whoami }' fails with an error that reads like a brace-matching problem.
Fixes #7267
Signed-off-by: Baltasar Blanco <baltasarblanco.dev@gmail.com>
This commit is contained in:
@@ -33,6 +33,15 @@ match on the query name will receive the query.
|
|||||||
server with no plugins will just return SERVFAIL for all queries. Each plugin can have a number of
|
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.
|
properties than can have arguments, see the documentation for each plugin.
|
||||||
|
|
||||||
|
The Corefile is line oriented: the arguments of a plugin, or of one of its properties, run until the
|
||||||
|
end of the line. Put each plugin, each property and each closing `}` on a line of its own. A `}` that
|
||||||
|
shares a line with a plugin or a property can be read as part of that line. For example, this fails
|
||||||
|
with "Unexpected '}' because no matching opening brace":
|
||||||
|
|
||||||
|
~~~ txt
|
||||||
|
. { whoami }
|
||||||
|
~~~
|
||||||
|
|
||||||
Comments are allowed and begin with an unquoted hash `#` and continue to the end of the line.
|
Comments are allowed and begin with an unquoted hash `#` and continue to the end of the line.
|
||||||
Comments may be started anywhere on a line.
|
Comments may be started anywhere on a line.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user