From 4ad0e8b45864f7c747860c8ecd83ff88a13d54dd Mon Sep 17 00:00:00 2001 From: Marek Vavrusa <marek@vavrusa.com> Date: Tue, 19 Jul 2016 21:36:20 -0700 Subject: [PATCH] daemon: lower minimum allowed edns bufsize to 512 there are cases where switches or middle-boxes block DNS/UDP answers >512 octets completely, this gives user an option to mitigate that. however, there are authoritatives serving large answers that don't support TCP, so it's a compromise as always --- daemon/README.rst | 2 +- lib/defines.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/README.rst b/daemon/README.rst index 155b0ea7e..13ddc1d7e 100644 --- a/daemon/README.rst +++ b/daemon/README.rst @@ -542,7 +542,7 @@ For when listening on ``localhost`` just doesn't cut it. .. function:: net.bufsize([udp_bufsize]) - Get/set maximum EDNS payload available. Default is 4096. + Get/set maximum EDNS payload available. Default is 1452, increase it in cases when authoritatives send large payloads over UDP and don't support TCP. You cannot set less than 512 (512 is DNS packet size without EDNS, 1220 is minimum size for DNSSEC) or more than 65535 octets. Example output: diff --git a/lib/defines.h b/lib/defines.h index a9baf643b..6a6523360 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -63,7 +63,7 @@ static inline int __attribute__((__cold__)) kr_error(int x) { #define KR_DNS_PORT 53 #define KR_DNS_TLS_PORT 853 #define KR_EDNS_VERSION 0 -#define KR_EDNS_PAYLOAD 4096 /* Default UDP payload (max unfragmented UDP is 1452B) */ +#define KR_EDNS_PAYLOAD 1452 /* Default UDP payload (max unfragmented UDP is 1452B) */ /* * Address sanitizer hints. -- GitLab