envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
24.28k stars 4.69k forks source link

no_default_search_domain does not take effect #33138

Open parbres opened 3 months ago

parbres commented 3 months ago

no_default_search_domain in dns_resolver_options does not take effect

Description: I am using dynamic_forward_proxy cluster, and sub_clusters_config is selected. To suppress too many request towards local DNS, I configured DNS resolver in cluster level image

But the test result is that envoy still search the default domain, and dns resolution failed in my case. my host name in request is: a.com my expectation is envoy query a.com directly to my configured dns server the result is envoy query a.com.mynamespace.svc.cluster.local, mynamespace.svc.cluster.local is the first records in my /etc/resolv.conf

in my /etc/resolv.conf: search mynamespace.svc.cluster.local svc.cluster.local cluster.local abcd nameserver 1.1.1.1 options ndots:5

yanavlasov commented 3 months ago

I've added help wanted label, in case someone wanted to diagnose the problem here. It could be an issue with the ares library too. I will take a look when I have time.

arulthileeban commented 6 days ago

Believe this is stemming from c-ares and there is already a fix: https://github.com/c-ares/c-ares/pull/638. The issue occurs with both static/dynamic clusters in the current version (v1.21.0), but upgrading to the latest 1.31.0 fixes the issue at hand, which I've manually been able to test.

I can raise a PR to upgrade the library to the latest version, unless there's any objections

EDIT: There seems to be a PR #33880 already to upgrade to a required version for this, but tests seem to break for ARM. I can look further