| 1 |
.\" Generated by Mmark Markdown Processor - mmark.miek.nl |
| 2 |
.TH "DBFILE" 7 "August 2026" "atomdns handlers" "atomdns authors" |
| 3 |
|
| 4 |
.SH "NAME" |
| 5 |
.PP |
| 6 |
\fIdbfile\fP \- serve zone data from an RFC 1035\-style file |
| 7 |
|
| 8 |
.SH "DESCRIPTION" |
| 9 |
.PP |
| 10 |
The \fIdbfile\fP handler is used for DNS servers that serve from a file that loaded from disk, |
| 11 |
containing RFC 1035 styled data. If the zone file contains signatures (i.e., is signed using DNSSEC), correct |
| 12 |
DNSSEC answers are returned. Only NSEC is supported. See the \fIsign\fP handler if you want to sign and resign your |
| 13 |
zone automatically. |
| 14 |
|
| 15 |
.PP |
| 16 |
The server will reply with minimal responses by default. The \fIdbfile\fP handler will watch the zone file and when |
| 17 |
it receives a (kernel) notify it will reload the zone after 2 seconds. Regardless of any change it will send out |
| 18 |
notifies if configured to do so, the actual SOA serial isn't relevant. |
| 19 |
|
| 20 |
.SH "SYNTAX" |
| 21 |
.PP |
| 22 |
In it simplests form \fIdbfile\fP you can use: |
| 23 |
|
| 24 |
.PP |
| 25 |
.RS |
| 26 |
|
| 27 |
.nf |
| 28 |
dbfile FILE |
| 29 |
|
| 30 |
.fi |
| 31 |
.RE |
| 32 |
|
| 33 |
.IP \(bu 4 |
| 34 |
\fBFILE\fP the zone file to load. If the path is relative, the path from the global root config will be |
| 35 |
prepended to it. |
| 36 |
|
| 37 |
|
| 38 |
.PP |
| 39 |
If the handler block contains multiple zones, they all will use the \fIsame\fP \fBFILE\fP. And you must make |
| 40 |
sure that zone \fBFILE\fP is generic enough, i.e. use \fB\fC@\fR for origins instead of domain names. Note that this break |
| 41 |
incoming transfers and thus will lead to an error when attempted. |
| 42 |
|
| 43 |
.PP |
| 44 |
For extra control you can open the block and define multipe extra properties that deal with zone transfers. |
| 45 |
|
| 46 |
.PP |
| 47 |
.RS |
| 48 |
|
| 49 |
.nf |
| 50 |
dbfile FILE { |
| 51 |
transfer { |
| 52 |
from IP[:PORT] [IP[:PORT]]... { |
| 53 |
key NAME ALGORITHM SECRET |
| 54 |
} |
| 55 |
to [IP[:PORT]]... { |
| 56 |
notify IP[:PORT] [IP[:PORT]]... |
| 57 |
source IP|IFACE [IP|IFACE] |
| 58 |
key NAME ALGORITHM SECRET |
| 59 |
} |
| 60 |
} |
| 61 |
} |
| 62 |
|
| 63 |
.fi |
| 64 |
.RE |
| 65 |
|
| 66 |
.IP \(bu 4 |
| 67 |
\fB\fCtransfer\fR details how zone transfers are handled, \fB\fCfrom\fR deals with incoming AXFR from \fBIP\fP, and \fB\fCto\fR |
| 68 |
deals with outgoing ones. Without \fB\fCtransfer\fR all transfers are prohibited. When transfer from a secondary |
| 69 |
\fIall\fP SOA timers are ignored, every 10 time minutes the upstream(s) is(/are) check for SOA updates. |
| 70 |
|
| 71 |
.RS |
| 72 |
.IP \(en 4 |
| 73 |
\fB\fCfrom\fR allows for multiple upstream \fBIP\fPs to be specified, they will be tried in that order. Notifies |
| 74 |
from those servers will be matched against \fBIP\fPs. |
| 75 |
If \fB\fCfrom\fR is used \fImultipe\fP zones are disallowed, and will cause an error because the transferred zone |
| 76 |
cant be shared. To save the zone file the directory of \fBFILE\fP must be writeable. |
| 77 |
.IP \(en 4 |
| 78 |
The \fB\fCkey\fR specification is for TSIG signed transfers. The \fBSECRET\fP must be base64 encoded. |
| 79 |
.IP \(en 4 |
| 80 |
\fB\fCto\fR allows for multipe downstream \fBIP\fPs to be specified, those are all allowed to initiate a transfer. |
| 81 |
If there are no \fBIP\fPs specfied the AXFR is open to the entire internet. |
| 82 |
.IP \(en 4 |
| 83 |
If there is no \fB\fCnotify\fR the \fBIP\fPs as specified in \fB\fCto\fR are used for sending notifies. If you |
| 84 |
want to override this add a \fB\fCnotify\fR and put an (new) set of \fBIP\fPs there. There can be at the most two |
| 85 |
IPs here, one for IPv4 and one for IPv6. With \fB\fCsource\fR you can set the source(s) address when sending the |
| 86 |
notifies. You can use an interface name as \fBIFACE\fP and the routable IP address from the interface are also |
| 87 |
used. The TSIG key specification is identical to that of \fB\fCfrom\fR. For \fBIP\fP you can use IPv6 or IPv4 |
| 88 |
addresses, these are automatically matched up, i.e. a notify with a IPv4 address will use a IPv4 source and |
| 89 |
vice versa. |
| 90 |
|
| 91 |
.RE |
| 92 |
|
| 93 |
|
| 94 |
.PP |
| 95 |
Note that a bare \fB\fCtransfer\fR is enough to allow for outgoing transfers. |
| 96 |
|
| 97 |
.SH "EXAMPLES" |
| 98 |
.PP |
| 99 |
Load the \fB\fCexample.org\fR zone from \fB\fCdb.example.org\fR and allow transfers to the internet, but send |
| 100 |
notifies to 10.240.1.1 |
| 101 |
|
| 102 |
.PP |
| 103 |
.RS |
| 104 |
|
| 105 |
.nf |
| 106 |
example.org { |
| 107 |
dbfile db.example.org { |
| 108 |
transfer { |
| 109 |
to { |
| 110 |
notify 10.240.1.1 |
| 111 |
} |
| 112 |
} |
| 113 |
} |
| 114 |
} |
| 115 |
|
| 116 |
.fi |
| 117 |
.RE |
| 118 |
|
| 119 |
.PP |
| 120 |
Where \fB\fCdb.example.org\fR would contain RRs in the (text) presentation format from RFC 1035: |
| 121 |
|
| 122 |
.PP |
| 123 |
.RS |
| 124 |
|
| 125 |
.nf |
| 126 |
$ORIGIN example.org. |
| 127 |
@ 3600 IN SOA sns.dns.icann.org. noc.dns.icann.org. 2017042745 7200 3600 1209600 3600 |
| 128 |
3600 IN NS a.iana\-servers.net. |
| 129 |
3600 IN NS b.iana\-servers.net. |
| 130 |
|
| 131 |
www IN A 127.0.0.1 |
| 132 |
IN AAAA ::1 |
| 133 |
|
| 134 |
.fi |
| 135 |
.RE |
| 136 |
|
| 137 |
.PP |
| 138 |
Or use a single zone file for multiple zones: |
| 139 |
|
| 140 |
.PP |
| 141 |
.RS |
| 142 |
|
| 143 |
.nf |
| 144 |
example.org example.net { |
| 145 |
dbfile example.org.signed { |
| 146 |
transfer { |
| 147 |
to 10.240.1.1 { |
| 148 |
source eth0 |
| 149 |
} |
| 150 |
} |
| 151 |
} |
| 152 |
} |
| 153 |
|
| 154 |
.fi |
| 155 |
.RE |
| 156 |
|
| 157 |
.SH "SEE ALSO" |
| 158 |
.PP |
| 159 |
See the \fIsign\fP handler for signing your zones and see RFC 1035 for more info on how to structure zone files. |