mirror of
https://github.com/coredns/coredns.git
synced 2025-12-09 11:55:13 -05:00
plugin/secondary: don't duplicate apex records (#1413)
See #1400 and the discussion in that bug. Fixes #1400
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user