Visual RFC.
ALL RFCs / RFC 7766
Read the RFC ↗
RFC 7766 / DNS OVER TCP

Pipeline queries and match reordered replies

03

Pipelining means sending another query before the earlier reply arrives. A fast second lookup may finish first, even though TCP preserves the bytes in each direction.

RFC 7766 · § 7EXAMPLE
5 / 5
Pipeline queries and match reordered repliesAll transactions use TCP connection C1. Query A, ID 17, picnic.example. IN A, is outstanding; then query B, ID 18, tea.example. IN AAAA, is pipelined. B response arrives first and matches B, leaving A pending. A bad response with ID 17 and question wrong.example. IN A stops at a question-match gate before delivery and leaves A pending. Finally the matching A response completes A. Whole response order differs from request order, not TCP byte order.One connection C1 · two independent lookupsClientServerReply A · ID 17ID 17 · picnic.example. IN AA matched and deliveredOutstanding: noneMatch ID + question when present, on this connection
05
Complete A when its matching reply arrives.

ID 17 with picnic.example. IN A matches the remaining outstanding query on C1. Both transactions are now complete.

Source for this drawing: RFC 7766 · Read RFC section 7 ↗

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

A message needs an address.

Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

KEY POINT

Match the transaction, not its position in the queue.

  • Clients SHOULD pipeline queries and SHOULD NOT wait for each outstanding reply. Servers MUST expect pipelined queries, SHOULD process them concurrently, and SHOULD answer all of them.
  • Clients MUST NOT reuse the DNS Message ID of an in-flight query on the same connection. Stub and recursive resolvers MUST handle replies in a different order from requests.
  • Clients MUST match replies to outstanding queries on the same TCP connection using Message ID. If a question is present, they MUST also match QNAME (queried name), QCLASS (record class) and QTYPE (record type).
DETAILS

Servers are RECOMMENDED to prepare responses in parallel and send them out of order; recursive servers SHOULD return them as available. This is not reordered TCP bytes: complete B response bytes precede A response bytes. The failure gate illustrates preventing wrong delivery, not a mandated DNS error code. An absent question does not add a new requirement to reject an otherwise matching Message ID. Message matching is not authentication.

Read the RFC section ↗

All chapters in RFC 7766

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗