TCP vs. UDP in query responses?

Stephane Bortzmeyer bortzmeyer at nic.fr
Tue Jun 15 07:54:06 UTC 2004


On Mon, Jun 14, 2004 at 05:34:33PM -0700,
 Chris De Young <chd at arizona.edu> wrote 
 a message of 22 lines which said:

> My understanding is that DNS queries and responses by default use UDP,
> but will switch to TCP if the response record set is large (and TCP is
> used for zone transfers).  Am I correct?

Mostly, yes.

> If so, what determines when TCP is used vs. UDP? 

Typically, when the reply is truncated (TC bit set in the
response). Look what dig says when querying a large domain name, in a
TLD which has a very large set of nameservers:

~ % dig @f.root-servers.net A dfjldfsjhdsfgsdghjdfsdsgfshsdgvsidfuyg.doiusghqdsulghsdfjghsdjgidsfhvbbldfshglkjdfshgdfqgkj.dgsfgldsglkjsdhfgkjlzdhgkjsdfhgusdfghumsdfbjghsdlkj.rgsdgfsdkgfhdsfjhghldsjhglkjqshgfqjkyfgqzyukfdgqksdf.fdsgfhusdflihghsdgkhsfdgqhfglqshfdghqsfgf.sqdfffdgra.hk
;; Truncated, retrying in TCP mode.
...

RFC 1035 :

TC              TrunCation - specifies that this message was truncated
                due to length greater than that permitted on the
                transmission channel.


More information about the bind-users mailing list