DNS

DNS 19 BADMODE vs 22 BADTRUNC

Both DNS 19 (BADMODE) and 22 (BADTRUNC) belong to the DNS Response Codes (RCODEs) category. 19 indicates that bad TKEY Mode. The TKEY mode field contains a value not supported by the server. Meanwhile, 22 means that bad truncation. The TSIG record was truncated in a way that makes it impossible to verify the message signature.

Description

Bad TKEY Mode. The TKEY mode field contains a value not supported by the server.

When You See It

Your client attempted a TKEY key exchange using a mode (e.g., Diffie-Hellman, GSS-API) that the server does not support or has not been configured for.

How to Fix

Check which TKEY modes the server supports and configure your client to use a compatible mode. GSS-TSIG (mode 3) is the most widely deployed.

Description

Bad truncation. The TSIG record was truncated in a way that makes it impossible to verify the message signature.

When You See It

A large DNS response was truncated (TC bit set) but the TSIG MAC was computed over the full message, making the truncated version unverifiable.

How to Fix

Retry the query over TCP to avoid truncation. If using UDP, ensure your EDNS buffer size is large enough to receive the full signed response.

Key Differences

1.

DNS 19: Bad TKEY Mode. The TKEY mode field contains a value not supported by the server.

2.

DNS 22: Bad truncation. The TSIG record was truncated in a way that makes it impossible to verify the message signature.

3.

You encounter 19 when your client attempted a TKEY key exchange using a mode (e.g., Diffie-Hellman, GSS-API) that the server does not support or has not been configured for.

4.

You encounter 22 when a large DNS response was truncated (TC bit set) but the TSIG MAC was computed over the full message, making the truncated version unverifiable.

When to Use Which

For 19 (BADMODE): Check which TKEY modes the server supports and configure your client to use a compatible mode. GSS-TSIG (mode 3) is the most widely deployed. For 22 (BADTRUNC): Retry the query over TCP to avoid truncation. If using UDP, ensure your EDNS buffer size is large enough to receive the full signed response.

Learn More