CURLOPT_DNS_SHUFFLE_ADDRESSES.3 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" **************************************************************************
  22. .\"
  23. .TH CURLOPT_DNS_SHUFFLE_ADDRESSES 3 "3 March 2018" "libcurl 7.60.0" "curl_easy_setopt options"
  24. .SH NAME
  25. CURLOPT_DNS_SHUFFLE_ADDRESSES \- shuffle IP addresses for hostname
  26. .SH SYNOPSIS
  27. .nf
  28. #include <curl/curl.h>
  29. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DNS_SHUFFLE_ADDRESSES, long onoff);
  30. .fi
  31. .SH DESCRIPTION
  32. When a name is resolved and more than one IP address is returned, shuffle the
  33. order of all returned addresses so that they will be used in a random order.
  34. This is similar to the ordering behavior of gethostbyname which is no longer
  35. used on most platforms.
  36. Addresses will not be reshuffled if a name resolution is completed using the
  37. DNS cache. \fICURLOPT_DNS_CACHE_TIMEOUT(3)\fP can be used together with this
  38. option to reduce DNS cache timeout or disable caching entirely if frequent
  39. reshuffling is needed.
  40. Since the addresses returned will be reordered randomly, their order will not
  41. be in accordance with RFC 3484 or any other deterministic order that may be
  42. generated by the system's name resolution implementation. This may have
  43. performance impacts and may cause IPv4 to be used before IPv6 or vice versa.
  44. .SH DEFAULT
  45. 0 (disabled)
  46. .SH PROTOCOLS
  47. All
  48. .SH EXAMPLE
  49. .nf
  50. CURL *curl = curl_easy_init();
  51. if(curl) {
  52. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  53. curl_easy_setopt(curl, CURLOPT_DNS_SHUFFLE_ADDRESSES, 1L);
  54. curl_easy_perform(curl);
  55. /* always cleanup */
  56. curl_easy_cleanup(curl);
  57. }
  58. .fi
  59. .SH AVAILABILITY
  60. Added in 7.60.0
  61. .SH RETURN VALUE
  62. CURLE_OK or an error such as CURLE_UNKNOWN_OPTION.
  63. .SH "SEE ALSO"
  64. .BR CURLOPT_DNS_CACHE_TIMEOUT "(3), " CURLOPT_IPRESOLVE "(3), "