DNS

DNS 18 BADTIME vs 20 BADNAME

Both DNS 18 (BADTIME) and 20 (BADNAME) belong to the DNS Response Codes (RCODEs) category. 18 indicates that signature out of time window. The TSIG signature timestamp is outside the allowed clock skew, indicating a time synchronization issue. 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

Signature out of time window. The TSIG signature timestamp is outside the allowed clock skew, indicating a time synchronization issue.

When You See It

The clocks on the DNS client and server are too far apart (usually more than 5 minutes), causing TSIG signature validation to fail.

How to Fix

Synchronize clocks on both machines using NTP. Check that the TSIG fudge value (allowed skew) is reasonable — the default 300 seconds is usually sufficient.

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 18: Signature out of time window. The TSIG signature timestamp is outside the allowed clock skew, indicating a time synchronization issue.

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 18 when the clocks on the DNS client and server are too far apart (usually more than 5 minutes), causing TSIG signature validation to fail.

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 18 (BADTIME): Synchronize clocks on both machines using NTP. Check that the TSIG fudge value (allowed skew) is reasonable — the default 300 seconds is usually sufficient. 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