diff options
Diffstat (limited to 'plugin/kubernetes/handler.go')
-rw-r--r-- | plugin/kubernetes/handler.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/plugin/kubernetes/handler.go b/plugin/kubernetes/handler.go index 336fd08db..d673a7a40 100644 --- a/plugin/kubernetes/handler.go +++ b/plugin/kubernetes/handler.go @@ -22,18 +22,19 @@ func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.M state.Zone = zone var ( - records []dns.RR - extra []dns.RR - err error + records []dns.RR + extra []dns.RR + truncated bool + err error ) switch state.QType() { case dns.TypeA: - records, err = plugin.A(ctx, &k, zone, state, nil, plugin.Options{}) + records, truncated, err = plugin.A(ctx, &k, zone, state, nil, plugin.Options{}) case dns.TypeAAAA: - records, err = plugin.AAAA(ctx, &k, zone, state, nil, plugin.Options{}) + records, truncated, err = plugin.AAAA(ctx, &k, zone, state, nil, plugin.Options{}) case dns.TypeTXT: - records, err = plugin.TXT(ctx, &k, zone, state, nil, plugin.Options{}) + records, truncated, err = plugin.TXT(ctx, &k, zone, state, nil, plugin.Options{}) case dns.TypeCNAME: records, err = plugin.CNAME(ctx, &k, zone, state, plugin.Options{}) case dns.TypePTR: @@ -58,7 +59,7 @@ func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.M // Do a fake A lookup, so we can distinguish between NODATA and NXDOMAIN fake := state.NewWithQuestion(state.QName(), dns.TypeA) fake.Zone = state.Zone - _, err = plugin.A(ctx, &k, zone, fake, nil, plugin.Options{}) + _, _, err = plugin.A(ctx, &k, zone, fake, nil, plugin.Options{}) } if k.IsNameError(err) { @@ -81,6 +82,7 @@ func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.M m := new(dns.Msg) m.SetReply(r) + m.Truncated = truncated m.Authoritative = true m.Answer = append(m.Answer, records...) m.Extra = append(m.Extra, extra...) |