[dns-operations] Truncation query

Mark Andrews marka at isc.org
Wed Mar 15 05:58:00 UTC 2017

In message <2b6bf505-b437-8a27-0970-e2a3bb8d39f8 at redhat.com>, Florian Weimer wr
> On 02/06/2017 03:47 PM, Peter van Dijk wrote:
> > As I have understood the relevant RFCs, the counts should match what's
> > actually in the packet, and `harvesting' data from a truncated response
> > is allowed under limited circumstances. So if I have to guess, the
> > packet you are seeing is not valid.
> I agree that these packets are malformed because the header does not
> match what's in the packet.
> But our BIND-derived stub resolver creates such packets if the
> application calls one of the res_ lookup functions, TCP fallback
> happens, and the response is larger than the caller-supplied buffer.  In
> this case, the stub resolver just patches in the TC bit and truncates
> the DNS message to fit the application-supplied buffer, without further
> adjusting the DNS header.  And the truncation can happen in the middle
> of a resource record.

What a stub resolver does when passed a undersized buffer is a
completely different senario to what a server does.

Now if you are still on 16 bit hardware passing small response
buffers is still appropriate but anyone running on 32 bit or larger
hardware should be passing 65535 byte buffers.  That is what the
protocol expects.  We went through and updated all the buffers in
BIND 8 to 65535 byte buffers well over a decade ago.

> I don't think there is a better option to deal with this scenario
> (except perhaps not returning the response packet at all, just an error
> code).
> Thanks,
> Florian
> _______________________________________________
> dns-operations mailing list
> dns-operations at lists.dns-oarc.net
> https://lists.dns-oarc.net/mailman/listinfo/dns-operations
> dns-operations mailing list
> https://lists.dns-oarc.net/mailman/listinfo/dns-operations
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 dns-operations mailing list