Pcornel
Networking · Network & Protocols › DNS Protocol Reference

DNS Truncation & TCP Fallback

Cheat sheet · https://pcornel.dk/topic.php?topic=306

Back to the Topic

Answer

DNS normally uses UDP. When an answer is too large for the size the client accepts, the server sets the truncated flag, and the client repeats the question over TCP port 53.

Remember

DNS needs both UDP and TCP on port 53; TCP is not only for zone transfers. If TCP 53 is blocked, the retry fails. If large UDP replies are dropped on the path, not even the truncated flag arrives.

First checks

  • dig <name> <type> — says "Truncated, retrying in TCP mode" when it happens.
  • dig <name> <type> +notcp +ignore — shows the truncated UDP reply with the tc flag.
  • dig <name> <type> +tcp — TCP from the start.
  • dig <name> <type> +bufsize=512 +ignore — provoke truncation for a test.

Commands

dig
dig +tcp

Verify in this order

UDP query → answer fits: done; too large → truncated reply reaches the client → client opens TCP 53 → full answer over TCP

Where it usually breaks

local configuration → reachability/transport → request/negotiation → server or policy decision → response/state installation → client-visible result

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=306

Confirmation

Confirm action

Continue?