aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'plugin')
-rw-r--r--plugin/file/secondary.go2
-rw-r--r--plugin/file/zone.go10
2 files changed, 11 insertions, 1 deletions
diff --git a/plugin/file/secondary.go b/plugin/file/secondary.go
index 83887c9ed..0d8f70069 100644
--- a/plugin/file/secondary.go
+++ b/plugin/file/secondary.go
@@ -16,7 +16,7 @@ func (z *Zone) TransferIn() error {
m := new(dns.Msg)
m.SetAxfr(z.origin)
- z1 := z.Copy()
+ z1 := z.CopyWithoutApex()
var (
Err error
tr string
diff --git a/plugin/file/zone.go b/plugin/file/zone.go
index 1cef9dc3a..540c65f0b 100644
--- a/plugin/file/zone.go
+++ b/plugin/file/zone.go
@@ -67,6 +67,16 @@ func (z *Zone) Copy() *Zone {
return z1
}
+// CopyWithoutApex copies zone z without the Apex records.
+func (z *Zone) CopyWithoutApex() *Zone {
+ z1 := NewZone(z.origin, z.file)
+ z1.TransferTo = z.TransferTo
+ z1.TransferFrom = z.TransferFrom
+ z1.Expired = z.Expired
+
+ return z1
+}
+
// Insert inserts r into z.
func (z *Zone) Insert(r dns.RR) error {
r.Header().Name = strings.ToLower(r.Header().Name)