plugin/kubernetes: fix SOA response for non-apex queries (#4592)
* fix SOA response for non-apex queries Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * handle mixed case Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * do full string compare Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
parent
e1931d48d1
commit
d6d8a9974b
3 changed files with 17 additions and 2 deletions
|
@ -43,7 +43,9 @@ func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.M
|
|||
case dns.TypeSRV:
|
||||
records, extra, err = plugin.SRV(ctx, &k, zone, state, plugin.Options{})
|
||||
case dns.TypeSOA:
|
||||
records, err = plugin.SOA(ctx, &k, zone, state, plugin.Options{})
|
||||
if qname == zone {
|
||||
records, err = plugin.SOA(ctx, &k, zone, state, plugin.Options{})
|
||||
}
|
||||
case dns.TypeAXFR, dns.TypeIXFR:
|
||||
return dns.RcodeRefused, nil
|
||||
case dns.TypeNS:
|
||||
|
@ -82,7 +84,6 @@ func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.M
|
|||
m.Authoritative = true
|
||||
m.Answer = append(m.Answer, records...)
|
||||
m.Extra = append(m.Extra, extra...)
|
||||
|
||||
w.WriteMsg(m)
|
||||
return dns.RcodeSuccess, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue