Standard DNS Error
DNS messages have a standard structure defined in RFC 1035
https://www.rfc-editor.org/rfc/inline-errata/rfc1035.html
1. Standard DNS Request
A DNS request (or query) is sent from a client (resolver) to a DNS server to ask about a domain name.
Example:
Client asks: "What is the IP address of www.example.com?"
A request typically contains:
Header (with fields like ID, flags, opcode, etc.)
Question section (the query: name, type, class)
2. DNS Opcode
Opcode is a 4-bit field in the DNS header (bits 11–14) that specifies the kind of query.
Opcode Meaning
0 Standard query (QUERY) – most common (A, AAAA, MX, etc.)
1 Inverse query (IQUERY) – obsolete
2 Server status request (STATUS)
4 Notify (DNS NOTIFY, RFC 1996)
5 Update (DNS UPDATE, RFC 2136)
others Reserved / experimental
Most traffic uses opcode = 0.
3. DNS Rcode (Response Code)
Rcode is a 4-bit field in the DNS header that tells if the request succeeded or failed.
Rcode Meaning
0 NoError – success
1 FormErr – format error in query
2 ServFail – server failed to complete request
3 NXDomain – name does not exist
4 NotImp – operation not implemented
5 Refused – server refused to answer
6 YXDomain – name exists when it should not
7 YXRRSet – RR set exists when it should not
8 NXRRSet – RR set does not exist
9 NotAuth – not authoritative for zone
10 NotZone – name not in zone
16 BADVERS / BADSIG (EDNS extended codes)
≥17 Other extended errors
4. DNS Response
A DNS response is sent back from the DNS server to the client with the answer (if available).
Structure:
Header (with matching ID, flags, opcode, rcode)
Question (copied from request)
Answer section (the records: e.g., www.example.com. IN A 93.184.216.34)
Authority section (nameservers)
Additional section (extra info, like glue records or OPT for EDNS)
In short:
Request = client asking a question.
Opcode = type of query (standard, update, etc.).
Rcode = result code in the response (success, NXDOMAIN, etc.).
Response = server’s answer (with answers/authority/additional records).