DNS Query Flags and Their Meanings

DNS queries can include several flags that modify the behavior of the query and the response. Below is a list of common DNS query flags along with their explanations:

DNS Query Flags

FlagDescription
QRQuery/Response: This flag indicates whether the message is a query (0) or a response (1).
OPCODEOperation Code: This 4-bit field specifies the kind of query. Common values include:
0 – Standard Query
1 – Inverse Query
2 – Server Status Request
AAAuthoritative Answer: This flag is set in a response to indicate that the responding server is an authority for the domain queried.
TCTruncated: This flag indicates that the message is truncated. This occurs when the message size exceeds the maximum allowed size for UDP (512 bytes).
RDRecursion Desired: This flag is set by the client to indicate that it wants the server to perform recursive queries on its behalf.
RARecursion Available: This flag is set by the server in a response to indicate that it supports recursion.
ZReserved for Future Use: This 3-bit field is reserved for future use and should be set to zero in all queries and responses.
RCODEResponse Code: This 4-bit field indicates the response status. Common values include:
0 – No error
1 – Format error
2 – Server failure
3 – Name error
4 – Not implemented
5 – Refused
ADAuthenticated Data: This flag is set in a response to indicate that the data included in the response has been authenticated using DNSSEC.
CDChecking Disabled: This flag is set by the client to indicate that it does not want the server to perform DNSSEC validation on the response.

Explanation of Each Flag

QR (Query/Response):

  • Indicates whether the message is a query (0) or a response (1).

OPCODE (Operation Code):

  • Specifies the type of operation requested. Standard queries are typically represented by 0.

AA (Authoritative Answer):

  • Indicates that the responding server is an authoritative source for the queried domain.

TC (Truncated):

  • Indicates that the message was truncated due to size limitations, suggesting that the client may need to use TCP to obtain the full response.

RD (Recursion Desired):

  • Signals to the server that the client is requesting recursive resolution of the query.

RA (Recursion Available):

  • Indicates that the server is capable of performing recursive queries.

Z (Reserved for Future Use):

  • Should always be set to zero, as it is reserved for future use.

RCODE (Response Code):

  • Provides the status of the query response, indicating whether it was successful or if an error occurred.

AD (Authenticated Data):

  • Indicates that the data in the response has been authenticated via DNSSEC, ensuring its integrity.

CD (Checking Disabled):

  • Instructs the server to skip DNSSEC validation for this query, typically used in scenarios where the client does not trust the server’s validation process.

Conclusion

These flags play a crucial role in the operation of the DNS protocol, providing important information about the nature of the query and the response

This site uses cookies and requires your consent to load third-party services. By accepting, you authorize third-party content to load under your permission. Your acceptance will hide this banner for 180 days, after which it will reappear. We apologize for the inconvenience—this requirement is part of GDPR compliance, not by our choice. Privacy Policy

Scroll to Top