Re: dnscache and oversized answers

John Levine <[email protected]>
Newsgroups gmane.network.djbdns
Message-ID <[email protected]>
>On Mon, Oct 06, 2008 at 10:55:12 -0000, John Levine wrote:
>> One of my users noticed that MX lookups for xo.net were timing out.
>> The problem turns out to be that XO's name servers are putting in too
>> many additional section records and are returning oversized answers of
>> about 540 bytes, which dnscache then throws away.
>
>Try this.
>
>--- dns_transmit.c~	2008-01-09 00:50:09.559806518 +0200
>+++ dns_transmit.c	2008-10-06 14:16:28.539802762 +0300
>@@ -352,7 +352,7 @@ have sent query to curserver on UDP sock
>       if (errno == error_connrefused) if (d->udploop == 2) return 0;
>       return nextudp(d);
>     }
>-    if (r + 1 > sizeof udpbuf) return 0;
>+    if (r + 1 > sizeof udpbuf) return firsttcp(d);
> 
>     if (irrelevant(d,udpbuf,r)) return 0;
>     if (serverwantstcp(udpbuf,r)) return firsttcp(d);

Thanks, that works great.

From a security point of view, it'd probably be better to check the
irrelevant bit before falling back to TCP, but that seems like a minor
bug since at worst it'd provoke redundant lookups to the real server.

R's,
John
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.