Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS query sent out when the request with IPv6 address in authority #37906

Open
yiyibaoguo opened this issue Jan 7, 2025 · 1 comment
Open

Comments

@yiyibaoguo
Copy link

Title: DNS query sent out when the request with IPv6 address in authority - with HTTP dynamic forward proxy

Description:

When the http request with IPv6 address in authority such as http://[fd00:bada:194:99::98]:8285/test, the address can be directly used but the DNS query

Repro steps:

Curl command:
curl -g -k --request POST -H "Content-Type:application/json" --header "Accept:application/json" --data '{"nrfConfigs":{"nrfConfig":[{"apiName":"nnrf-nfm","apiPrefix":null,"apiSpecificResourceUriPart":null,"apiVersion":"v2","authority":[{"addressType":"primary","host":"10.10.45.34","port":"8089"}],"nrfConfigId":"nrf2","responseTimeout":"90","scheme":"http"}]}}' --proxy http://chfed.sbc.svc.cluster.local:10007 -v http://[fd00:bada:194:99::88]:8285/test-management/test

Filter - key config:
"http_filters": [
{
"name": "envoy.filters.http.dynamic_forward_proxy",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.dynamic_forward_proxy.v3.FilterConfig",
"dns_cache_config": {
"name": "dynamic_forward_proxy_cache_config",
"host_ttl": "7200s",
"dns_lookup_family": "V4_PREFERRED"
}
}
},

Cluster -key config:
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.clusters.dynamic_forward_proxy.v3.ClusterConfig",
"dns_cache_config": {
"name": "dynamic_forward_proxy_cache_config",
"host_ttl": "7200s",
"dns_lookup_family": "V4_PREFERRED"
},

image

Note: The Envoy_collect tool
gathers a tarball with debug logs, config and the following admin
endpoints: /stats, /clusters and /server_info. Please note if there are
privacy concerns, sanitize the data prior to sharing the tarball/pasting.

Admin and Stats Output:

Include the admin output for the following endpoints: /stats,
/clusters, /routes, /server_info. For more information, refer to the
admin endpoint documentation.

Note: If there are privacy concerns, sanitize the data prior to
sharing.

Config:

Include the config used to configure Envoy.

Logs:

Include the access logs and the Envoy logs.
image

Reference to the code envoy/source/extensions/network/dns_resolver/cares/dns_impl.cc, it seems to be related with the below code logic.
DnsResolverImpl::AddrInfoPendingResolution::AddrInfoPendingResolution(
DnsResolverImpl& parent, ResolveCb callback, Event::Dispatcher& dispatcher,
ares_channel channel, const std::string& dns_name, DnsLookupFamily dns_lookup_family)
: PendingResolution(parent, callback, dispatcher, channel, dns_name),
dns_lookup_family_(dns_lookup_family), available_interfaces_(availableInterfaces()) {
if (dns_lookup_family == DnsLookupFamily::Auto ||
dns_lookup_family == DnsLookupFamily::V4Preferred) {
dual_resolution_ = true;
}

switch (dns_lookup_family_) {
case DnsLookupFamily::V4Only:
case DnsLookupFamily::V4Preferred:
family_ = AF_INET;
break;
case DnsLookupFamily::V6Only:
case DnsLookupFamily::Auto:
family_ = AF_INET6;
break;
case DnsLookupFamily::All:
family_ = AF_UNSPEC;
break;
}
}

Note: If there are privacy concerns, sanitize the data prior to
sharing.

Call Stack:

If the Envoy binary is crashing, a call stack is required.
Please refer to the Bazel Stack trace documentation.

@zuercher
Copy link
Member

zuercher commented Jan 7, 2025

cc @alyssawilk @mattklein123

@zuercher zuercher removed the triage Issue requires triage label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants