mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
plugin/secondary: don't duplicate apex records (#1413)
See #1400 and the discussion in that bug. Fixes #1400
This commit is contained in:
@@ -16,7 +16,7 @@ func (z *Zone) TransferIn() error {
|
|||||||
m := new(dns.Msg)
|
m := new(dns.Msg)
|
||||||
m.SetAxfr(z.origin)
|
m.SetAxfr(z.origin)
|
||||||
|
|
||||||
z1 := z.Copy()
|
z1 := z.CopyWithoutApex()
|
||||||
var (
|
var (
|
||||||
Err error
|
Err error
|
||||||
tr string
|
tr string
|
||||||
|
|||||||
@@ -67,6 +67,16 @@ func (z *Zone) Copy() *Zone {
|
|||||||
return z1
|
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.
|
// Insert inserts r into z.
|
||||||
func (z *Zone) Insert(r dns.RR) error {
|
func (z *Zone) Insert(r dns.RR) error {
|
||||||
r.Header().Name = strings.ToLower(r.Header().Name)
|
r.Header().Name = strings.ToLower(r.Header().Name)
|
||||||
|
|||||||
Reference in New Issue
Block a user