Max response packet size ?

Mark Andrews marka at isc.org
Mon Sep 12 02:40:53 UTC 2011


In message <53281.1315691737 at tristatelogic.com>, "Ronald F. Guilmette" writes:
> 
> When called, res_query must be passed the base address of a buffer
> (`answer'), and the maximum length of that buffer (`anslen').  Upon
> return, res_query returns the count of bytes bytes actually used in
> the target buffer (i.e. the response packet size) or else -1 for errors.
> 
> Assuming that one wishes to call res_query in a manner that allows for the
> largest possible response packet size, what size should the `answer'
> buffer have, and what value should `anslen' have?

The maximum DNS message size is 65535 bytes.  AXFR/IXFR are a series of
messages.
 
> I'm sorry to bother you all with this trivia question, but I have not
> found any place where this value (max DNS packet size) is documented.
> 
> Of course, at the dawn of DNS, the answer... for UDP response packets,
> at least... was 512.  But it appears to me that response packets sent
> via TCP can be up to 1<<16 (64KB) in length, and I have no idea what,
> if any limits might apply to EDNS packets sent via UDP.
 
EDNS is theoretically 65535 bytes but it is recommended to use a
smaller size even if your OS supports it.  4096 is common.

> Regards,
> rfg
> _______________________________________________
> Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe
>  from this list
> 
> bind-users mailing list
> bind-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/bind-users
-- 
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: marka at isc.org



More information about the bind-users mailing list