aboutsummaryrefslogtreecommitdiff
path: root/middleware/file/file.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2016-03-28 12:08:05 +0100
committerGravatar Miek Gieben <miek@miek.nl> 2016-03-28 18:23:17 +0100
commite56d206542c901a48b28c4501fe5805e9e9e1a10 (patch)
tree77a644f6fe28f3de8eaf6f7c766cea73b438b487 /middleware/file/file.go
parent6324bb1fa7c0516ef3bebfb822a0cdc767764ad2 (diff)
downloadcoredns-e56d206542c901a48b28c4501fe5805e9e9e1a10.tar.gz
coredns-e56d206542c901a48b28c4501fe5805e9e9e1a10.tar.zst
coredns-e56d206542c901a48b28c4501fe5805e9e9e1a10.zip
Support outgoing zone transfers
These can be enabled by adding "transfer out" to the Corefile. Without it no AXFR is allowed. For now only AXFR and no IXFR. No TSIG and no ACLs.
Diffstat (limited to 'middleware/file/file.go')
-rw-r--r--middleware/file/file.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/middleware/file/file.go b/middleware/file/file.go
index 5e4e0b357..237515a57 100644
--- a/middleware/file/file.go
+++ b/middleware/file/file.go
@@ -1,10 +1,5 @@
package file
-// TODO(miek): the zone's implementation is basically non-existent
-// we return a list and when searching for an answer we iterate
-// over the list. This must be moved to a tree-like structure and
-// have some fluff for DNSSEC (and be memory efficient).
-
import (
"io"
"log"
@@ -19,7 +14,6 @@ type (
File struct {
Next middleware.Handler
Zones Zones
- // Maybe a list of all zones as well, as a []string?
}
Zones struct {
@@ -40,6 +34,11 @@ func (f File) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i
return f.Next.ServeDNS(ctx, w, r)
}
+ if state.Proto() != "udp" && state.QType() == dns.TypeAXFR {
+ xfr := Xfr{z}
+ return xfr.ServeDNS(ctx, w, r)
+ }
+
rrs, extra, result := z.Lookup(qname, state.QType(), state.Do())
m := new(dns.Msg)