DNS

DNS 17 BADKEY vs 19 BADMODE

Both DNS 17 (BADKEY) and 19 (BADMODE) belong to the DNS Response Codes (RCODEs) category. 17 indicates that key not recognized. The TSIG key name in the message is not configured on the server. Meanwhile, 19 means that bad TKEY Mode. The TKEY mode field contains a value not supported by the server.

Description

Key not recognized. The TSIG key name in the message is not configured on the server.

When You See It

Your TSIG-signed query or update references a key name that the server does not have in its keyring, so it cannot verify the signature.

How to Fix

Ensure the TSIG key name matches exactly (case-sensitive) on both client and server. Add the missing key to the server's configuration if it is a new key.

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.

Key Differences

1.

DNS 17: Key not recognized. The TSIG key name in the message is not configured on the server.

2.

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

3.

You encounter 17 when your TSIG-signed query or update references a key name that the server does not have in its keyring, so it cannot verify the signature.

4.

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.

When to Use Which

For 17 (BADKEY): Ensure the TSIG key name matches exactly (case-sensitive) on both client and server. Add the missing key to the server's configuration if it is a new key. 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.

Learn More