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?
to your account
Started a DNS server on localhost:5353 and ran curl --dns-servers 127.0.0.1:5353 www.example.com
curl --dns-servers 127.0.0.1:5353 www.example.com
The documentation indicated that port numbers are passed through to c-ares; however, I believe that this is not the case.
curl to make a DNS request to 127.0.0.1:5353
curl made a DNS request to 127.0.0.1:53. I confirmed with strace that nothing ever tried to talk to :5353 and that starting my custom server as root on port 53 instead worked.
curl 7.65.1 (x86_64-redhat-linux-gnu) libcurl/7.65.1 OpenSSL/1.0.2s zlib/1.2.3 c-ares/1.15.0 libidn2/2.0.5 libssh2/1.8.2 nghttp2/1.39.1
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB SPNEGO SSL UnixSockets
diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c
index 8561a4724..198d3d6e6 100644
@@ -734,7 +734,11 @@ CURLcode Curl_set_dns_servers(struct Curl_easy *data,
#if (ARES_VERSION >= 0x010704)
+#if (ARES_VERSION >= 0x011100)
+ ares_result = ares_set_servers_ports_csv(data->state.resolver, servers);
ares_result = ares_set_servers_csv(data->state.resolver, servers);
result = CURLE_OK;
I have not tested this patch and there do not appear to be any unit tests of this functionality.
The text was updated successfully, but these errors were encountered:
Thanks! The report and fix seem correct.
Can you turn the fix into a PR or would you like me to do it for you?
Sorry, something went wrong.
Successfully merging a pull request may close this issue.