Started a DNS server on localhost:5353 and ran 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.
I expected the following
curl to make a DNS request to 127.0.0.1:5353
What happened instead?
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.
Can you turn the fix into a PR or would you like me to do it for you?
Roguelazer
changed the title
--dns-resolvers flag and CURLOPT_DNS_SERVERS ignores port number
--dns-servers flag and CURLOPT_DNS_SERVERS ignores port number
Jun 24, 2019
I did this
Started a DNS server on localhost:5353 and ran
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.
I expected the following
curl to make a DNS request to 127.0.0.1:5353
What happened instead?
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/libcurl version
operating system
CentOS 6
I believe the following patch will fix this issue
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: