DNS 16 BADVERS/BADSIG vs 20 BADNAME
Both DNS 16 (BADVERS/BADSIG) and 20 (BADNAME) belong to the DNS Response Codes (RCODEs) category. 16 indicates that bad OPT Version or TSIG Signature Failure. Either the EDNS version in the OPT record is not supported, or the TSIG signature on the message failed verification. Meanwhile, 20 means that duplicate key name. The key name in a TKEY negotiation is already in use or conflicts with an existing key.
Description
Bad OPT Version or TSIG Signature Failure. Either the EDNS version in the OPT record is not supported, or the TSIG signature on the message failed verification.
When You See It
As BADVERS: your client sent an EDNS version higher than the server supports. As BADSIG: the TSIG MAC on the message did not match, indicating a shared-secret mismatch or message tampering.
How to Fix
For BADVERS, downgrade the EDNS version (most servers support version 0 only). For BADSIG, regenerate and re-synchronize the TSIG shared secret on both endpoints.
Description
Duplicate key name. The key name in a TKEY negotiation is already in use or conflicts with an existing key.
When You See It
A TKEY key establishment failed because a key with the same name already exists on the server from a previous session that was not properly cleaned up.
How to Fix
Use a unique key name for each TKEY session (e.g., append a timestamp or random suffix). Delete stale keys on the server if they are no longer needed.
Key Differences
DNS 16: Bad OPT Version or TSIG Signature Failure. Either the EDNS version in the OPT record is not supported, or the TSIG signature on the message failed verification.
DNS 20: Duplicate key name. The key name in a TKEY negotiation is already in use or conflicts with an existing key.
You encounter 16 when as BADVERS: your client sent an EDNS version higher than the server supports. As BADSIG: the TSIG MAC on the message did not match, indicating a shared-secret mismatch or message tampering.
You encounter 20 when a TKEY key establishment failed because a key with the same name already exists on the server from a previous session that was not properly cleaned up.
When to Use Which
For 16 (BADVERS/BADSIG): For BADVERS, downgrade the EDNS version (most servers support version 0 only). For BADSIG, regenerate and re-synchronize the TSIG shared secret on both endpoints. For 20 (BADNAME): Use a unique key name for each TKEY session (e.g., append a timestamp or random suffix). Delete stale keys on the server if they are no longer needed.