Skip to content

network: enable EDNS for DNS queries#10589

Merged
edsiper merged 1 commit intofluent:masterfrom
stek29:fix/dns-edns-support
Jul 14, 2025
Merged

network: enable EDNS for DNS queries#10589
edsiper merged 1 commit intofluent:masterfrom
stek29:fix/dns-edns-support

Conversation

@stek29
Copy link
Contributor

@stek29 stek29 commented Jul 13, 2025

Enable EDNS0 for all DNS queries to match c-ares defaults and support responses larger than 512 bytes.

Partially addresses #10588

@cosmo0920
Copy link
Contributor

Hi,
The patch looks good but we need to follow DCO workflow.
So, could you add Signed-Off line by git add -s?
The detail is here: https://github.com/fluent/fluent-bit/pull/10589/checks?check_run_id=45884364947

Always set ARES_FLAG_EDNS to handle DNS responses >512 bytes.
Fixes: fluent#10588

Signed-off-by: Viktor Oreshkin <[email protected]>
@cosmo0920 cosmo0920 added this to the Fluent Bit v4.0.5 milestone Jul 14, 2025
@edsiper
Copy link
Member

edsiper commented Jul 14, 2025

@stek29 thanks for this PR.

wondering what's the right path here and potential side-effects of this change. The biggest user of c-ares is Curl, however I cannot find a reference to this flag being used in Curl and wondering the reason about it:

looking at c-ares options init functionality, the flag ARES_FLAG_EDNS is not enabled by default:

removed.. "why do we really need this flag ? " (edited)

looking at #10588 more in detail now

@edsiper edsiper merged commit 7a52469 into fluent:master Jul 14, 2025
71 of 74 checks passed
@stek29
Copy link
Contributor Author

stek29 commented Jul 15, 2025

@edsiper just to clarify:

it is enabled by default in c-ares, but it's part of flags — so it's only enabled if ARES_OPT_FLAGS is unset:
https://github.com/c-ares/c-ares/blob/71663adcd95acdb1c198806d626dfc8640d132be/src/lib/ares_init.c#L132-L135

and most clients, including curl, just don’t set the ARES_OPT_FLAGS.
but fluent-bit does set this option, because it conditionally sets flag ARES_FLAG_USEVC:

fluent-bit/src/flb_network.c

Lines 1091 to 1100 in 9def01d

/* c-ares options: Set the transport layer to the desired protocol */
optmask = ARES_OPT_FLAGS;
if (dns_mode == FLB_DNS_USE_TCP) {
opts.flags = ARES_FLAG_USEVC;
}
*result = ares_init_options((ares_channel *) &lookup_context->ares_channel,
&opts, optmask);

@stek29 stek29 deleted the fix/dns-edns-support branch July 15, 2025 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants