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, 10 Jun 2024 17:17:53 +0000 (20:17 +0300)
commit2419c0ba48f0134acd78d5b6f78935d02f353b51
tree58705d498fe7a65010e46b8d26d46027f27e3c9c
parent4186a8f9f0fa977c2f75750aa1003d1011eddb97
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