DNS

DNS 5 REFUSED vs 22 BADTRUNC

Both DNS 5 (REFUSED) and 22 (BADTRUNC) belong to the DNS Response Codes (RCODEs) category. 5 indicates that query refused. The name server refuses to perform the requested operation for policy reasons. Meanwhile, 22 means that bad truncation. The TSIG record was truncated in a way that makes it impossible to verify the message signature.

คำอธิบาย

Query refused. The name server refuses to perform the requested operation for policy reasons.

เมื่อคุณพบเห็น

The server rejected your query due to access control — for example, a recursive resolver that only serves its own network, or a zone transfer blocked by ACL.

วิธีแก้ไข

Check the server's allow-query, allow-recursion, or allow-transfer ACLs. If you are not authorized to use this resolver, switch to a public DNS service.

คำอธิบาย

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

เมื่อคุณพบเห็น

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

วิธีแก้ไข

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.

ความแตกต่างหลัก

1.

DNS 5: Query refused. The name server refuses to perform the requested operation for policy reasons.

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 5 when the server rejected your query due to access control — for example, a recursive resolver that only serves its own network, or a zone transfer blocked by ACL.

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.

ควรใช้อันไหนเมื่อไร

For 5 (REFUSED): Check the server's allow-query, allow-recursion, or allow-transfer ACLs. If you are not authorized to use this resolver, switch to a public DNS service. 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.

เรียนรู้เพิ่มเติม