nrfxlib API 0.1.0
Loading...
Searching...
No Matches

◆ nrf_setdnsaddr()

int nrf_setdnsaddr ( int  family,
const void *  in_addr,
nrf_socklen_t  in_size 
)

#include <nrf_modem/include/nrf_socket.h>

Set a secondary DNS address.

The secondary DNS address is only used in case the primary DNS address is unreachable, or if no DNS address is provided by the operator. The secondary DNS address does not override the primary DNS address.

Note
It is not possible to unset a secondary DNS address set using this function.
Parameters
familyAddress family.
in_addrAn IPv4 or IPv6 address encoded in a nrf_in_addr or nrf_in6_addr structure, respectively.
in_sizeSize of the structure pointed to by in_addr.
Return values
0On success
-1On error, and set errno to indicate the reason.

The function may return -1 and set the following errno:

  • [NRF_EPERM] The Modem library is not initialized.
  • [NRF_EAFNOSUPPORT] The implementation does not support the specified address family.
  • [NRF_EINVAL] Invalid parameters.
  • [NRF_ENOBUFS] Not enough shared memory for this request.
  • [NRF_ESHUTDOWN] Modem was shut down.