plugin/secondary: don't duplicate apex records (#1413)

See #1400 and the discussion in that bug.

Fixes #1400
This commit is contained in:
Miek Gieben
2018-01-23 10:35:31 +00:00
committed by GitHub
parent 85457cf50d
commit 9575789c36
2 changed files with 11 additions and 1 deletions

View File

@@ -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

View File

@@ -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)