COREFILE(5)
π COREFILE(5) π
okay so this is the corefile man page, bestie β the configuration file for CoreDNS, and honestly? iconic. let's get into it π
πΈ NAME πΈ
corefile β configuration file for CoreDNS, no cap.
β¨ DESCRIPTION β¨
A corefile specifies the internal servers CoreDNS should run and what plugins each of these should chain. The syntax is giving:
[SCHEME://]ZONE [[SCHEME://]ZONE]...[:PORT] {
[PLUGIN]...
}
ZONEdefines for which name this server should be called. Multiple zones are allowed and should be white space separated. You can use a βreverseβ syntax to specify a reverse zone (i.e.ip6.arpaandin-addr.arpa) by using an IP address in the CIDR notation.- The optional
SCHEMEdefaults todns://, but can also betls://(DNS over TLS),grpc://(DNS over gRPC) orhttps://(DNS over HTTP/2). - The optional
PORTcontrols on which port the server will bind; this defaults to53. If you use a port number here, you can't override it with-dns.port(coredns(1)), also seecoredns-bind(7). - Specifying a
ZONEandPORTcombination multiple times for different servers will lead to an error on startup. - When a query comes in, it is matched against all zones for all servers; the server with the longest match on the query name will receive the query.
PLUGINdefines the plugin(s) we want to load into this server. This is optional as well, but a server with no plugins will just returnSERVFAILfor all queries. Each plugin can have a number of properties that 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:
. { whoami }
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.
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β (see coredns-import(7)) to include parts of other files.
If CoreDNS can't find a Corefile to load, it loads the following builtin one:
. {
whoami
log
}
π IMPORT π
You can use the import βpluginβ to include parts of other files, see https://coredns.io/plugins/import, and coredns-import(7).
π¦ SNIPPETS π¦
If you want to reuse a snippet, you can define one and then use it with import.
(mysnippet) {
log
whoami
}
. {
import mysnippet
}
π EXAMPLES π
The ZONE is root zone ., the PLUGIN is chaos. The chaos plugin takes an (optional) argument: CoreDNS-001. This text is returned on a CH class query: dig CH TXT version.bind @localhost.
. {
chaos CoreDNS-001
}
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:
example.org {
whoami
}
org {
whoami
}
Is identical to:
example.org org {
whoami
}
Reverse zones can be specified as domain names:
0.0.10.in-addr.arpa {
whoami
}
or by just using the CIDR notation:
10.0.0.0/24 {
whoami
}
This also works on a non octet boundary:
10.0.0.0/27 {
whoami
}
π AUTHORS π
CoreDNS Authors.
β COPYRIGHT β
Apache License 2.0
π SEE ALSO π
The manual page for CoreDNS: coredns(1) and more documentation on https://coredns.io. Also see the import documentation at https://coredns.io/plugins/import and all the manual pages for the plugins.
byeee from CoreDNS, October 2026 edition β COREFILE(5) out π«Άπ
β¨
π¦ where this page comes from
- opensuse-leap 16.0: coredns-extras 1.15.0-bp160.1.1 Β· Apache-2.0 AND MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms