| 1 |
.\" Generated by Mmark Markdown Processor - mmark.miek.nl |
| 2 |
.TH "CONFFLE" 5 "August 2026" "atomdns" "atomdns authors" |
| 3 |
|
| 4 |
.SH "NAME" |
| 5 |
.PP |
| 6 |
\fIconffile\fP \- configuration file for atomdns |
| 7 |
|
| 8 |
.SH "DESCRIPTION" |
| 9 |
.PP |
| 10 |
A \fIconffile\fP specifies the handlers atomdns should chain. The syntax is as follows: |
| 11 |
|
| 12 |
.PP |
| 13 |
.RS |
| 14 |
|
| 15 |
.nf |
| 16 |
ZONE[/CLASS] [ZONE[/CLASS]]... { |
| 17 |
[HANDLER]... |
| 18 |
} |
| 19 |
|
| 20 |
.fi |
| 21 |
.RE |
| 22 |
|
| 23 |
.PP |
| 24 |
Such a section is called a \fIhandler block\fP. Each block defines the handlers this server should run |
| 25 |
when it gets a query for one the \fBZONE\fPs. |
| 26 |
|
| 27 |
.PP |
| 28 |
The \fBZONE\fP defines for which zones this handler should be called, multiple zones are allowed and must be |
| 29 |
\fIwhite space\fP separated. If \fB/CLASS\fP is not speficied in IN class is assumed, for CH class zones use |
| 30 |
\fB/CH\fP, IN and CH are the only supported classes at this point. |
| 31 |
|
| 32 |
.PP |
| 33 |
When a query comes in, it is matched again all zones of all handlers blocks, the block with the longest match for the |
| 34 |
query name will receive the query and runs it through it's defined handlers. |
| 35 |
|
| 36 |
.PP |
| 37 |
\fBHANDLER\fP defines the handlers(s) we want to load. This is optional as well, but a block with no handlers |
| 38 |
will just return REFUSED for all queries. Each handler can have a number of properties that can have |
| 39 |
arguments, see the documentation for each handler (atomdns\-\fBHANDLER\fP(7)). |
| 40 |
|
| 41 |
.PP |
| 42 |
The order of the \fBHANDLER\fPs is the order in which they are executed! (If you know CoreDNS, this is |
| 43 |
different, as which CoreDNS the order is fixed compile time). I.e. putting the \fIlog\fP handler (atomdns\-log(7)) |
| 44 |
as last, means no queries are logged. |
| 45 |
|
| 46 |
.PP |
| 47 |
Comments are allowed and begin with an unquoted hash \fB\fC#\fR and continue to the end of the line. Comments may be |
| 48 |
started anywhere on a line. |
| 49 |
|
| 50 |
.PP |
| 51 |
Environment variables are supported and either the Unix or Windows form may be used: \fB\fC{$ENV_VAR_1}\fR or |
| 52 |
\fB\fC{%ENV_VAR_2%}\fR. |
| 53 |
|
| 54 |
.PP |
| 55 |
The \fB\fC~\fR (tilde) character and path names will be expanded to the home directory of the current user. |
| 56 |
|
| 57 |
.PP |
| 58 |
As an way to test things Conffile also supports a shorter way of writing things, but this only works for a |
| 59 |
single handler: |
| 60 |
|
| 61 |
.PP |
| 62 |
.RS |
| 63 |
|
| 64 |
.nf |
| 65 |
ZONE[/CLASS] [ZONE[/CLASS]]... |
| 66 |
[HANDLER]... |
| 67 |
|
| 68 |
.fi |
| 69 |
.RE |
| 70 |
|
| 71 |
.PP |
| 72 |
I.e. |
| 73 |
|
| 74 |
.PP |
| 75 |
.RS |
| 76 |
|
| 77 |
.nf |
| 78 |
example.org |
| 79 |
log |
| 80 |
whoami |
| 81 |
|
| 82 |
.fi |
| 83 |
.RE |
| 84 |
|
| 85 |
.PP |
| 86 |
Or |
| 87 |
|
| 88 |
.PP |
| 89 |
.RS |
| 90 |
|
| 91 |
.nf |
| 92 |
example.org/IN |
| 93 |
log |
| 94 |
whoami |
| 95 |
|
| 96 |
.fi |
| 97 |
.RE |
| 98 |
|
| 99 |
.PP |
| 100 |
Is a valid configuration and is supported by \fB\fCatomdns\fR. |
| 101 |
|
| 102 |
.SH "GLOBAL" |
| 103 |
.PP |
| 104 |
A Conffile must have a global block, this is a block without a zone and holds server wide |
| 105 |
options, like how many instances to run, if you want DOH and DOT servers, etc. etc. For each server type |
| 106 |
(DNS \- plain DNS, DOT \- DNS over TLS, DOH \- DNS over HTTP, and DOU \- DNS over Unix sockets) |
| 107 |
you have a section \fB\fCdns\fR, \fB\fCdot\fR, \fB\fCdoh\fR and \fB\fCdou\fR where you can configure the server, most notably the |
| 108 |
address and port you want to listen on. |
| 109 |
|
| 110 |
.PP |
| 111 |
.RS |
| 112 |
|
| 113 |
.nf |
| 114 |
{ |
| 115 |
dns { |
| 116 |
addr [::]:1053 |
| 117 |
} |
| 118 |
root /var/lib/atomdns |
| 119 |
metrics localhost:9153 |
| 120 |
} |
| 121 |
|
| 122 |
.fi |
| 123 |
.RE |
| 124 |
|
| 125 |
.PP |
| 126 |
Here we say we should only run a DNS server listening on port 1053 on all addresses, set the \fB\fCroot\fR directory |
| 127 |
to "/var/lib/atomdns" and enable metrics. See atomdns\-global(7) for more information. |
| 128 |
|
| 129 |
.SH "IMPORT" |
| 130 |
.PP |
| 131 |
You can use the \fIimport\fP "handler" to include parts of other files, or snippets that are defined in the |
| 132 |
configuration file see atomdns\-import(7). To prevent infinite recursion a maximum of a 1000 imports are allowed. |
| 133 |
|
| 134 |
.SH "SNIPPETS" |
| 135 |
.PP |
| 136 |
If you want to reuse a snippet you can define one with and then use it with \fIimport\fP. |
| 137 |
|
| 138 |
.PP |
| 139 |
.RS |
| 140 |
|
| 141 |
.nf |
| 142 |
(mysnippet) { |
| 143 |
log |
| 144 |
whoami |
| 145 |
} |
| 146 |
|
| 147 |
example.org { |
| 148 |
import mysnippet |
| 149 |
} |
| 150 |
|
| 151 |
.fi |
| 152 |
.RE |
| 153 |
|
| 154 |
.SH "EXAMPLES" |
| 155 |
.PP |
| 156 |
The \fBZONE\fP is root zone \fB\fC.\fR, the \fBhandler\fP is \fIchaos\fP. The \fIchaos\fP handler takes an (optional) argument: |
| 157 |
\fB\fCatomdns-001\fR. This text is returned on a CH class query: \fB\fCdig CH TXT version.bind @localhost\fR. To only have |
| 158 |
this zone match the CH class, use \fB/CH\fP. |
| 159 |
|
| 160 |
.PP |
| 161 |
.RS |
| 162 |
|
| 163 |
.nf |
| 164 |
\&./CH { |
| 165 |
chaos atomdns\-001 |
| 166 |
} |
| 167 |
|
| 168 |
.fi |
| 169 |
.RE |
| 170 |
|
| 171 |
.PP |
| 172 |
When defining a new zone, you either create a new block, or add it to an existing one. Here we define two |
| 173 |
blocks that each handle a different zone, that potentially chain different handlers: |
| 174 |
|
| 175 |
.PP |
| 176 |
.RS |
| 177 |
|
| 178 |
.nf |
| 179 |
example.org { |
| 180 |
whoami |
| 181 |
} |
| 182 |
org { |
| 183 |
whoami |
| 184 |
} |
| 185 |
|
| 186 |
.fi |
| 187 |
.RE |
| 188 |
|
| 189 |
.PP |
| 190 |
But this is identical to: |
| 191 |
|
| 192 |
.PP |
| 193 |
.RS |
| 194 |
|
| 195 |
.nf |
| 196 |
example.org org { |
| 197 |
whoami |
| 198 |
} |
| 199 |
|
| 200 |
.fi |
| 201 |
.RE |
| 202 |
|
| 203 |
.PP |
| 204 |
Reverse zones can be specified as domain names: |
| 205 |
|
| 206 |
.PP |
| 207 |
.RS |
| 208 |
|
| 209 |
.nf |
| 210 |
0.0.10.in\-addr.arpa { |
| 211 |
whoami |
| 212 |
} |
| 213 |
|
| 214 |
.fi |
| 215 |
.RE |
| 216 |
|
| 217 |
.PP |
| 218 |
Or by just using the CIDR notation: |
| 219 |
|
| 220 |
.PP |
| 221 |
.RS |
| 222 |
|
| 223 |
.nf |
| 224 |
10.0.0.0/24 { |
| 225 |
whoami |
| 226 |
} |
| 227 |
|
| 228 |
.fi |
| 229 |
.RE |
| 230 |
|
| 231 |
.PP |
| 232 |
This also works on a non octet boundary: |
| 233 |
|
| 234 |
.PP |
| 235 |
.RS |
| 236 |
|
| 237 |
.nf |
| 238 |
10.0.0.0/27 { |
| 239 |
whoami |
| 240 |
} |
| 241 |
|
| 242 |
.fi |
| 243 |
.RE |
| 244 |
|
| 245 |
.PP |
| 246 |
Doing Let's Encrypt certificates for your DOH servers: |
| 247 |
|
| 248 |
.PP |
| 249 |
.RS |
| 250 |
|
| 251 |
.nf |
| 252 |
{ |
| 253 |
root /var/lib/atomdns |
| 254 |
|
| 255 |
dns { |
| 256 |
addr [::]:1053 |
| 257 |
limits { |
| 258 |
tcp \-1 |
| 259 |
run numcpu()*3 |
| 260 |
} |
| 261 |
} |
| 262 |
doh { |
| 263 |
addr [::]:10053 |
| 264 |
limits { |
| 265 |
run numcpu()*1 |
| 266 |
} |
| 267 |
} |
| 268 |
tls lets\-encrypt { |
| 269 |
source eth0 |
| 270 |
contact [email protected] |
| 271 |
directory lets\-encrypt |
| 272 |
} |
| 273 |
} |
| 274 |
|
| 275 |
example.net { |
| 276 |
log |
| 277 |
dbfile example.net |
| 278 |
} |
| 279 |
|
| 280 |
.fi |
| 281 |
.RE |
| 282 |
|
| 283 |
.SH "AUTHORS" |
| 284 |
.PP |
| 285 |
atomdns authors. |
| 286 |
|
| 287 |
.SH "COPYRIGHT" |
| 288 |
.PP |
| 289 |
Apache License 2.0 |
| 290 |
|
| 291 |
.SH "SEE ALSO" |
| 292 |
.PP |
| 293 |
The manual page for atomdns: atomdns(1) and the manual pages for the handlers. Particular atomdns\-global(7) |
| 294 |
for the server parameters. |