Discussion:
[PATCH] MINOR: dns: Set maximum DNS udp payload at 65507
Anthonin Bonnefoy
2018-10-18 15:52:47 UTC
Permalink
From: Anthonin Bonnefoy <***@datadoghq.com>

With EDNS, DNS packets can have a maximum size of 65507.
This will allow to have a bigger accepted_payload_size which is useful
when we have more than 100 SRV records.
---
include/types/dns.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/types/dns.h b/include/types/dns.h
index 488d3996..53f24c19 100644
--- a/include/types/dns.h
+++ b/include/types/dns.h
@@ -42,7 +42,10 @@
*/
#define DNS_MAX_LABEL_SIZE 63
#define DNS_MAX_NAME_SIZE 255
-#define DNS_MAX_UDP_MESSAGE 8192
+/* With EDNS, DNS message can reach the maximum size of an UDP message
+ * which is (65535 - 8 bytes UDP header - 20 bytes IP header)
+ */
+#define DNS_MAX_UDP_MESSAGE 65507

/* DNS minimun record size: 1 char + 1 NULL + type + class */
#define DNS_MIN_RECORD_SIZE (1 + 1 + 2 + 2)
--
2.13.2
Willy Tarreau
2018-12-02 17:46:01 UTC
Permalink
Post by Anthonin Bonnefoy
With EDNS, DNS packets can have a maximum size of 65507.
This will allow to have a bigger accepted_payload_size which is useful
when we have more than 100 SRV records.
Baptiste, please have a look at this one, I want to be sure we don't
miss it if needed.

Thanks,
Willy
Post by Anthonin Bonnefoy
---
include/types/dns.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/types/dns.h b/include/types/dns.h
index 488d3996..53f24c19 100644
--- a/include/types/dns.h
+++ b/include/types/dns.h
@@ -42,7 +42,10 @@
*/
#define DNS_MAX_LABEL_SIZE 63
#define DNS_MAX_NAME_SIZE 255
-#define DNS_MAX_UDP_MESSAGE 8192
+/* With EDNS, DNS message can reach the maximum size of an UDP message
+ * which is (65535 - 8 bytes UDP header - 20 bytes IP header)
+ */
+#define DNS_MAX_UDP_MESSAGE 65507
/* DNS minimun record size: 1 char + 1 NULL + type + class */
#define DNS_MIN_RECORD_SIZE (1 + 1 + 2 + 2)
--
2.13.2
Loading...