diff options
Diffstat (limited to 'plugin/erratic/erratic.go')
-rw-r--r-- | plugin/erratic/erratic.go | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/plugin/erratic/erratic.go b/plugin/erratic/erratic.go index 290e0c2cc..3460f3bca 100644 --- a/plugin/erratic/erratic.go +++ b/plugin/erratic/erratic.go @@ -61,14 +61,26 @@ func (e *Erratic) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg rr := *(rrAAAA.(*dns.AAAA)) rr.Header().Name = state.QName() m.Answer = append(m.Answer, &rr) + case dns.TypeAXFR: + if drop { + return 0, nil + } + if delay { + time.Sleep(e.duration) + } + + xfr(state, trunc) + return 0, nil + default: - if !drop { - if delay { - time.Sleep(e.duration) - } - // coredns will return error. - return dns.RcodeServerFailure, nil + if drop { + return 0, nil + } + if delay { + time.Sleep(e.duration) } + // coredns will return error. + return dns.RcodeServerFailure, nil } if drop { |