mirror of
https://github.com/coredns/coredns.git
synced 2025-11-30 07:34:02 -05:00
plugin/file: make non-existent file non-fatal (#2955)
* plugin/file: make non-existent file non-fatal If the zone file being loaded doesn't exist *and* reload is enabled, just wait the file to pop up in the normal Reload routine. If reload is set to 0s; we keep this a fatal error on startup. Aslo fix the ticker in z.Reload(): remove the per second ticks and just use the reload interval for the ticker. Brush up the documentation a bit as well. Fixes: #2951 Signed-off-by: Miek Gieben <miek@miek.nl> * Stickler and test compile Signed-off-by: Miek Gieben <miek@miek.nl> * Remove there too Signed-off-by: Miek Gieben <miek@miek.nl> * Cant README test these because zone files dont exist Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
## Description
|
||||
|
||||
The file plugin is used for an "old-style" DNS server. It serves from a preloaded file that exists
|
||||
The *file* plugin is used for an "old-style" DNS server. It serves from a preloaded file that exists
|
||||
on disk. If the zone file contains signatures (i.e., is signed using DNSSEC), correct DNSSEC answers
|
||||
are returned. Only NSEC is supported! If you use this setup *you* are responsible for re-signing the
|
||||
zonefile.
|
||||
@@ -44,7 +44,7 @@ file DBFILE [ZONES... ] {
|
||||
Load the `example.org` zone from `example.org.signed` and allow transfers to the internet, but send
|
||||
notifies to 10.240.1.1
|
||||
|
||||
~~~ corefile
|
||||
~~~ txt
|
||||
example.org {
|
||||
file example.org.signed {
|
||||
transfer to *
|
||||
@@ -55,7 +55,7 @@ example.org {
|
||||
|
||||
Or use a single zone file for multiple zones:
|
||||
|
||||
~~~
|
||||
~~~ txt
|
||||
. {
|
||||
file example.org.signed example.org example.net {
|
||||
transfer to *
|
||||
@@ -67,7 +67,7 @@ Or use a single zone file for multiple zones:
|
||||
Note that if you have a configuration like the following you may run into a problem of the origin
|
||||
not being correctly recognized:
|
||||
|
||||
~~~
|
||||
~~~ txt
|
||||
. {
|
||||
file db.example.org
|
||||
}
|
||||
@@ -78,7 +78,7 @@ which, in this case, is the root zone. Any contents of `db.example.org` will the
|
||||
origin set; this may or may not do what you want.
|
||||
It's better to be explicit here and specify the correct origin. This can be done in two ways:
|
||||
|
||||
~~~
|
||||
~~~ txt
|
||||
. {
|
||||
file db.example.org example.org
|
||||
}
|
||||
@@ -86,8 +86,12 @@ It's better to be explicit here and specify the correct origin. This can be done
|
||||
|
||||
Or
|
||||
|
||||
~~~
|
||||
~~~ txt
|
||||
example.org {
|
||||
file db.example.org
|
||||
}
|
||||
~~~
|
||||
|
||||
## Also See
|
||||
|
||||
See the *loadbalance* plugin if you need simple record shuffling.
|
||||
|
||||
Reference in New Issue
Block a user