code: func (rw Rewrite) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
  	wr := NewResponseReverter(w, r)
  	for _, rule := range rw.Rules {
  		switch result := rule.Rewrite(w, r); result {
  		case RewriteDone:
  			if rule.Mode() == Stop {
  				if rw.noRevert {
  					return plugin.NextOrFailure(rw.Name(), rw.Next, ctx, w, r)
  				}
  				return plugin.NextOrFailure(rw.Name(), rw.Next, ctx, wr, r)
  			}
  		case RewriteIgnored:
  			break
  		case RewriteStatus:
  			// only valid for complex rules.
  			// if cRule, ok := rule.(*ComplexRule); ok && cRule.Status != 0 {
  			// return cRule.Status, nil
  			// }
  		}
  	}
  	return plugin.NextOrFailure(rw.Name(), rw.Next, ctx, w, r)
  }
docs: // ServeDNS implements the plugin.Handler interface.