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>
Wed, 8 May 2024 10:23:57 +0000 (13:23 +0300)
commit9a2cd467b252fc6daafe0d25eaa42530731bc43c
tree65547a31a3d95814133a2251c89d290036c26ca5
parent2f5f8eec62d6d2f76125ba8e19f1a7d4adc5b9dc
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