diff options
author | 2018-01-23 10:35:31 +0000 | |
---|---|---|
committer | 2018-01-23 10:35:31 +0000 | |
commit | 9575789c363d9fc72eb96f3263e94d2037142335 (patch) | |
tree | 152e41f0ce61ce94818ad1fc844dd01cfcaf5cb4 /plugin/file/zone.go | |
parent | 85457cf50dd45a4b3cbf9425007831ee07d34916 (diff) | |
download | coredns-9575789c363d9fc72eb96f3263e94d2037142335.tar.gz coredns-9575789c363d9fc72eb96f3263e94d2037142335.tar.zst coredns-9575789c363d9fc72eb96f3263e94d2037142335.zip |
plugin/secondary: don't duplicate apex records (#1413)
See #1400 and the discussion in that bug.
Fixes #1400
Diffstat (limited to 'plugin/file/zone.go')
-rw-r--r-- | plugin/file/zone.go | 10 |
1 files changed, 10 insertions, 0 deletions
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) |