coredns/coredns · warning · plugin.Error

unhandled response type %q for %q

Error message

unhandled response type %q for %q

What it means

CoreDNS's minimal plugin returns this error from ServeDNS when a response's classification is not NoError yet was not a Denial, Error, or Delegation either. The plugin only minimizes successful (NOERROR, non-delegation) answers; anything else reaching this branch is a state it does not know how to handle, so it writes the original message and returns a plugin error.

Source

Thrown at plugin/minimal/minimal.go:43

	rcode, err := plugin.NextOrFailure(m.Name(), m.Next, ctx, nw, r)
	if err != nil {
		return rcode, err
	}
	if nw.Msg == nil {
		return rcode, nil
	}

	ty, _ := response.Typify(nw.Msg, time.Now().UTC())
	cl := response.Classify(ty)

	// if response is Denial or Error pass through also if the type is Delegation pass through
	if cl == response.Denial || cl == response.Error || ty == response.Delegation {
		w.WriteMsg(nw.Msg)
		return 0, nil
	}
	if ty != response.NoError {
		w.WriteMsg(nw.Msg)
		return 0, plugin.Error("minimal", fmt.Errorf("unhandled response type %q for %q", ty, nw.Msg.Question[0].Name))
	}

	// copy over the original Msg params, deep copy not required as RRs are not modified
	d := &dns.Msg{
		MsgHdr:   nw.Msg.MsgHdr,
		Compress: nw.Msg.Compress,
		Question: nw.Msg.Question,
		Answer:   nw.Msg.Answer,
		Ns:       nil,
		Extra:    nil,
	}

	w.WriteMsg(d)
	return 0, nil
}

View on GitHub (pinned to 558c9757a9)

Solutions

  1. Inspect the upstream response's RCODE/classification with packet capture or logging to see why it is neither NoError, Denial, Error, nor Delegation
  2. Check the CoreDNS version for response.Typify changes; upgrade to a release where the classification is handled
  3. Remove or restrict the minimal plugin from server blocks whose upstreams produce non-NOERROR responses
  4. File/patch the plugin to handle the missing response type

Example fix

// before
if ty != response.NoError {
    return 0, plugin.Error("minimal", fmt.Errorf("unhandled response type %q for %q", ty, nw.Msg.Question[0].Name))
}
// after
if cl != response.NoError {
    w.WriteMsg(nw.Msg)
    return 0, nil // or handle the specific type explicitly
}
Defensive patterns

Strategy: fallback

Validate before calling

ty := response.Typify(nw.Msg)
cl := response.Classify(nw.Msg)
if cl != response.NoError { /* log and pass through the original message */ }

Try / catch

if code, err := plugin.ServeDNS(...); err != nil { log.Warningf("minimal: %v", err); /* original msg already written */ }

Prevention

When it happens

Trigger: ServeDNS receives a response whose response.Typify classification (ty) is not response.NoError while also not being Denial, Error, or Delegation — e.g. an unusual RCODE/classification combination produced upstream that falls outside the enumerated cases.

Common situations: Upstream resolvers or forward targets returning unexpected RCODEs or malformed replies; new response classifications added upstream without updating minimal's switch; running minimal in front of non-DNS-conformant backends.

Related errors


AI-assisted analysis of coredns/coredns@558c9757a9 (2026-09-06). Data as JSON: /api/errors/e1da42fa82673db7. Report an issue: GitHub.