aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/xfr.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/kubernetes/xfr.go')
-rw-r--r--plugin/kubernetes/xfr.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugin/kubernetes/xfr.go b/plugin/kubernetes/xfr.go
index 812604966..b82c4d144 100644
--- a/plugin/kubernetes/xfr.go
+++ b/plugin/kubernetes/xfr.go
@@ -38,6 +38,17 @@ func (k *Kubernetes) Transfer(zone string, serial uint32) (<-chan []dns.RR, erro
}
ch <- soa
+ nsAddrs := k.nsAddrs(false, zone)
+ nsHosts := make(map[string]struct{})
+ for _, nsAddr := range nsAddrs {
+ nsHost := nsAddr.Header().Name
+ if _, ok := nsHosts[nsHost]; !ok {
+ nsHosts[nsHost] = struct{}{}
+ ch <- []dns.RR{&dns.NS{Hdr: dns.RR_Header{Name: zone, Rrtype: dns.TypeNS, Class: dns.ClassINET, Ttl: k.ttl}, Ns: nsHost}}
+ }
+ ch <- nsAddrs
+ }
+
sort.Slice(serviceList, func(i, j int) bool {
return serviceList[i].Name < serviceList[j].Name
})