diff options
Diffstat (limited to 'plugin/auto/xfr.go')
-rw-r--r-- | plugin/auto/xfr.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/plugin/auto/xfr.go b/plugin/auto/xfr.go new file mode 100644 index 000000000..6fef8b9e8 --- /dev/null +++ b/plugin/auto/xfr.go @@ -0,0 +1,19 @@ +package auto + +import ( + "github.com/coredns/coredns/plugin/transfer" + + "github.com/miekg/dns" +) + +// Transfer implements the transfer.Transfer interface. +func (a Auto) Transfer(zone string, serial uint32) (<-chan []dns.RR, error) { + a.Zones.RLock() + z, ok := a.Zones.Z[zone] + a.Zones.RUnlock() + + if !ok || z == nil { + return nil, transfer.ErrNotAuthoritative + } + return z.Transfer(serial) +} |