.\" Generated by Mmark Markdown Processor - mmark.miek.nl .TH "CONFFLE" 5 "August 2026" "atomdns" "atomdns authors" .SH "NAME" .PP \fIconffile\fP \- configuration file for atomdns .SH "DESCRIPTION" .PP A \fIconffile\fP specifies the handlers atomdns should chain. The syntax is as follows: .PP .RS .nf ZONE[/CLASS] [ZONE[/CLASS]]... { [HANDLER]... } .fi .RE .PP Such a section is called a \fIhandler block\fP. Each block defines the handlers this server should run when it gets a query for one the \fBZONE\fPs. .PP The \fBZONE\fP defines for which zones this handler should be called, multiple zones are allowed and must be \fIwhite space\fP separated. If \fB/CLASS\fP is not speficied in IN class is assumed, for CH class zones use \fB/CH\fP, IN and CH are the only supported classes at this point. .PP When a query comes in, it is matched again all zones of all handlers blocks, the block with the longest match for the query name will receive the query and runs it through it's defined handlers. .PP \fBHANDLER\fP defines the handlers(s) we want to load. This is optional as well, but a block with no handlers will just return REFUSED for all queries. Each handler can have a number of properties that can have arguments, see the documentation for each handler (atomdns\-\fBHANDLER\fP(7)). .PP The order of the \fBHANDLER\fPs is the order in which they are executed! (If you know CoreDNS, this is different, as which CoreDNS the order is fixed compile time). I.e. putting the \fIlog\fP handler (atomdns\-log(7)) as last, means no queries are logged. .PP Comments are allowed and begin with an unquoted hash \fB\fC#\fR and continue to the end of the line. Comments may be started anywhere on a line. .PP Environment variables are supported and either the Unix or Windows form may be used: \fB\fC{$ENV_VAR_1}\fR or \fB\fC{%ENV_VAR_2%}\fR. .PP The \fB\fC~\fR (tilde) character and path names will be expanded to the home directory of the current user. .PP As an way to test things Conffile also supports a shorter way of writing things, but this only works for a single handler: .PP .RS .nf ZONE[/CLASS] [ZONE[/CLASS]]... [HANDLER]... .fi .RE .PP I.e. .PP .RS .nf example.org log whoami .fi .RE .PP Or .PP .RS .nf example.org/IN log whoami .fi .RE .PP Is a valid configuration and is supported by \fB\fCatomdns\fR. .SH "GLOBAL" .PP A Conffile must have a global block, this is a block without a zone and holds server wide options, like how many instances to run, if you want DOH and DOT servers, etc. etc. For each server type (DNS \- plain DNS, DOT \- DNS over TLS, DOH \- DNS over HTTP, and DOU \- DNS over Unix sockets) 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 address and port you want to listen on. .PP .RS .nf { dns { addr [::]:1053 } root /var/lib/atomdns metrics localhost:9153 } .fi .RE .PP Here we say we should only run a DNS server listening on port 1053 on all addresses, set the \fB\fCroot\fR directory to "/var/lib/atomdns" and enable metrics. See atomdns\-global(7) for more information. .SH "IMPORT" .PP You can use the \fIimport\fP "handler" to include parts of other files, or snippets that are defined in the configuration file see atomdns\-import(7). To prevent infinite recursion a maximum of a 1000 imports are allowed. .SH "SNIPPETS" .PP If you want to reuse a snippet you can define one with and then use it with \fIimport\fP. .PP .RS .nf (mysnippet) { log whoami } example.org { import mysnippet } .fi .RE .SH "EXAMPLES" .PP The \fBZONE\fP is root zone \fB\fC.\fR, the \fBhandler\fP is \fIchaos\fP. The \fIchaos\fP handler takes an (optional) argument: \fB\fCatomdns-001\fR. This text is returned on a CH class query: \fB\fCdig CH TXT version.bind @localhost\fR. To only have this zone match the CH class, use \fB/CH\fP. .PP .RS .nf \&./CH { chaos atomdns\-001 } .fi .RE .PP When defining a new zone, you either create a new block, or add it to an existing one. Here we define two blocks that each handle a different zone, that potentially chain different handlers: .PP .RS .nf example.org { whoami } org { whoami } .fi .RE .PP But this is identical to: .PP .RS .nf example.org org { whoami } .fi .RE .PP Reverse zones can be specified as domain names: .PP .RS .nf 0.0.10.in\-addr.arpa { whoami } .fi .RE .PP Or by just using the CIDR notation: .PP .RS .nf 10.0.0.0/24 { whoami } .fi .RE .PP This also works on a non octet boundary: .PP .RS .nf 10.0.0.0/27 { whoami } .fi .RE .PP Doing Let's Encrypt certificates for your DOH servers: .PP .RS .nf { root /var/lib/atomdns dns { addr [::]:1053 limits { tcp \-1 run numcpu()*3 } } doh { addr [::]:10053 limits { run numcpu()*1 } } tls lets\-encrypt { source eth0 contact miek@miek.nl directory lets\-encrypt } } example.net { log dbfile example.net } .fi .RE .SH "AUTHORS" .PP atomdns authors. .SH "COPYRIGHT" .PP Apache License 2.0 .SH "SEE ALSO" .PP The manual page for atomdns: atomdns(1) and the manual pages for the handlers. Particular atomdns\-global(7) for the server parameters.