CURL.SetOptionDNSShuffleAddresses
---------------------------------

Whether to shuffle DNS addresses.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CURL](component_CURL.md) | [8.2](newinversion82.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "CURL.SetOptionDNSShuffleAddresses"; curl; Value ) 

**MBS**( **"CURL.SetOptionDNSShuffleAddresses";** /\* Whether to shuffle DNS addresses. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Value**) /\* The new setting, 1 or 0e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| curl | The CURL session handle. | $curl |
| Value | The new setting, 1 or 0 | 1 |

### Result

Returns OK or error.

### Description

Whether to shuffle DNS addresses.  
When a name is resolved and more than one IP address is returned, shuffle the order of all returned addresses so that they will be used in a random order. This is similar to the ordering behavior of gethostbyname which is no longer used on most platforms.  
  
Addresses will not be reshuffled if a name resolution is completed using the DNS cache. [CURL.SetOptionDNSCacheTimeout](CURLSetOptionDNSCacheTimeout.md) can be used together with this option to reduce DNS cache timeout or disable caching entirely if frequent reshuffling is needed.  
  
Since the addresses returned will be reordered randomly, their order will not be in accordance with RFC 3484 or any other deterministic order that may be generated by the system's name resolution implementation. This may have performance impacts and may cause IPv4 to be used before IPv6 or vice versa.  
Default is 0.  
See also [DNS\_SHUFFLE\_ADDRESSES](https://curl.haxx.se/libcurl/c/CURLOPT_DNS_SHUFFLE_ADDRESSES.html) option in CURL manual.

### See also

- [CURL.SetOptionDNSCacheTimeout](CURLSetOptionDNSCacheTimeout.md)

### Release notes

- **Version 8.2**
    - Added [CURL.SetOptionDNSShuffleAddresses](http://www.mbsplugins.eu/CURLSetOptionDNSShuffleAddresses.shtml) and [CURL.SetOptionHAProxyProtocol](http://www.mbsplugins.eu/CURLSetOptionHAProxyProtocol.shtml).

### Blog Entries

- [MBS FileMaker Plugin, version 8.2pr8](https://www.mbsplugins.de/archive/2018-05-16/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)

Created 16th May 2018 , last changed 16th May 2018

  
[CURL.SetOptionDNSServers](CURLSetOptionDNSServers.md) - [CURL.SetOptionDOHSSLVerifyHost](CURLSetOptionDOHSSLVerifyHost.md)

[HTML Version](CURLSetOptionDNSShuffleAddresses.shtml)