Minimal EDNS0 support for built-in DNS client
authorMichael Tokarev <mjt@tls.msk.ru>
Mon, 26 Feb 2024 11:15:00 +0000 (14:15 +0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Mon, 6 Jan 2025 18:20:31 +0000 (21:20 +0300)
commitebca56746f19739a0b7e9ab0006a056d9f91ab02
tree9f72324203868752bd3a4d813e24150b9958c851
parent4ef674cb0c4cd0fc795224f3792cfb6f589d6422
Minimal EDNS0 support for built-in DNS client

Forwarded: yes
Bug: https://bugzilla.samba.org/show_bug.cgi?id=15536

Currently, samba built-in DNS client is UDP-only (it does
support TCP mode, but not all components use it).  In
particular, when winbind queries list of AD DCs (SRV
record) which can be quite large, it uses UDP-only query.
And at the same time, samba DNS client does not support
EDNS0 at all, so the reply is limited to standard DNS
packet size which is 512 bytes.

Add minimal EDNS0 OPT record to ADDITIONAL section when
sending a DNS request out, indicating we can accept
DNS packets up to 4Kb in size.

Since DNSSEC is in wide use today and DNSSEC requires
EDNS0, it is okay to assume ENDS0 is widely supported
these days, so there should be no regressions when
enabling EDNS0.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Gbp-Pq: Name edns0.patch
libcli/dns/dns.c