Menu

#68 Make CURLOPT_INTERFACE affect DNS requests too (where possible)

closed-accepted
None
2014-01-10
2013-02-08
Kim Vandry
No

I am using curl_easy_setopt(CURLOPT_INTERFACE, "if!something") to force transfers to use a particular interface but this doesn't make DNS requests use that interface.

I think most users would expect use of CURLOPT_INTERFACE to affect all network traffic generated by the transfer including DNS requests.

If c-ares is in use, this is actually easy to implement. With the attached patch, when using CURLOPT_INTERFACE, DNS requests are also bound to the specified interface. If c-ares is not in use or if the c-ares version is too old to support this, the behaviour is the same as it is now. I could have made it fail with CURLE_NOT_BUILT_IN but I don't think that's a good idea.

1 Attachments

Discussion

  • Daniel Stenberg

    Daniel Stenberg - 2013-09-30
    • status: open --> closed-accepted
    • assigned_to: Daniel Stenberg
    • Group: -->
     
  • Daniel Stenberg

    Daniel Stenberg - 2013-09-30

    merged in current git now!

     

Log in to post a comment.