nrfxlib API 3.3.99
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 or unset a fallback DNS address.

The fallback DNS address is used only when the network-provided DNS addresses are missing or unreachable. The fallback DNS does not override the network-provided DNS.

Parameters
familyAddress family, either NRF_AF_INET or NRF_AF_INET6.
in_addrAn IPv4 or IPv6 address encoded in a nrf_in_addr or nrf_in6_addr structure, respectively. To unset the fallback DNS address, in_addr must be NULL.
in_sizeSize of the structure pointed to by in_addr. To unset the fallback DNS address, in_size must be 0 (when in_addr is NULL).
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_EINVAL] Invalid parameters.
  • [NRF_EAFNOSUPPORT] The implementation does not support the specified address family.
  • [NRF_ENOBUFS] Not enough shared memory for this request.
  • [NRF_ESHUTDOWN] Modem was shut down.