DNS

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

1.

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.

2.

DNS 20: Duplicate key name. The key name in a TKEY negotiation is already in use or conflicts with an existing key.

3.

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.

4.

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.

Learn More